Vba Current Workbook Directory. Hi All, I am writing a macro that starts in one workbook (who's file name will change weekly) and will also access a reference sheet on the network. The first one is. 'Get Active Workbook Path sWBPath = ActiveWorkbook.
In case of a Workbook this can be expressed in several ways which are discussed here. Public CHIR As String Private Sub Auto_open() Application. The goal is to copy the reference sheet into the first workbook.
The method you choose would If you want to close all the workbooks, except the workbook that has the current code in it.
This is the one that has all the macro code in it Alternative Code for Copying Data to Your Current Workbook.
VBA ThisWorkbook means the workbook in which we are writing the excel code. After your VBA macro / code has performed all the required actions, you would want the macro to either save the file or skip saving it. In case of a Workbook this can be expressed in several ways which are discussed here.