Patricia0923
New Member
- Joined
- Mar 18, 2014
- Messages
- 25
Hi,
I need to write code such that when the workbook is opened at any location (can be up to 14,000 stores) I can open a directory on a virtual drive R (which is localized to that location) to access folders located there and pull data.
Currently, I inherited a file that says this, but I don't understand what it does or why it was written that way. Can anyone help, please. Thanks.
LOG_Dir = Left(ThisWorkbook.Path, Len(ThisWorkbook.Path) -5) & "\logs\"
ChDrive Left(ThisWorkbook.Path, InStr(1, ThisWorkbook.Path,":"))
ChDir ThisWorkbook.Path
ChDir "..\..\data"
DATA_DIR = CurDir()
I need to write code such that when the workbook is opened at any location (can be up to 14,000 stores) I can open a directory on a virtual drive R (which is localized to that location) to access folders located there and pull data.
Currently, I inherited a file that says this, but I don't understand what it does or why it was written that way. Can anyone help, please. Thanks.
LOG_Dir = Left(ThisWorkbook.Path, Len(ThisWorkbook.Path) -5) & "\logs\"
ChDrive Left(ThisWorkbook.Path, InStr(1, ThisWorkbook.Path,":"))
ChDir ThisWorkbook.Path
ChDir "..\..\data"
DATA_DIR = CurDir()