Vba Current Workbook Location. The goal is to copy the reference sheet into the first workbook. Set a workbook object = to the current workbook something like this. dim wbkCurrent as workbook.
Private Sub Workbook_Open() Call ReadDataFromCloseFile End Sub. Here we have already saved an excel workbook in the name of "Test File" Our current sheet again gets unlocked. Path + "\" + "данные.xls" With Workbooks("данные.xls") CHIR =.
FullName for the path Both are useful in different situations, of course.
Referencing workbooks and sheets programmatically generates a lot of confusion because there are so many possibilities.
The active workbook may or may not contain the code that's referencing. Do not paste the code below to a regular module, that won't work. The Workbook Object appears next below the Application Object in Excel VBA object hierarchy, and represents a 'save the new workbook, omitting the file format, this will save in the default file format of your current Excel version when you are saving a new file: ActiveWorkbook.