Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I'd appreciate help from anyone that can point me in the correct
direction here... I want to open a spreadsheet (call this A) that includes a VB macro, and the macro will open another spreadsheet (call this B) that will always be stored in the same directory as spreadsheet A. Now, at one point during a month, spreadsheets A and B are in one directory, later in the month they gets moved to a history directory. What code do I need to use to have the open always point to the directory that spreadsheet A and B are stored in? Would Curdir be the correct one to use? Is there a way to retrieve the directory path spreadsheet A is contained in, and then use that as part of the Open path for spreadsheet B? TIA for the assistance. Rodg2000 (remove the _nospam to reply) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use...
Workbooks.Open ThisWorkbook.Path & "\Book2.xls" where ThisWorkbook.Path = the path of spreadsheet A "\Book2.xls" = name of spreadsheet B -- _______________________ Robert Rosenberg R-COR Consulting Services Microsoft MVP - Excel "Rodg2000" wrote in message ... Hi, I'd appreciate help from anyone that can point me in the correct direction here... I want to open a spreadsheet (call this A) that includes a VB macro, and the macro will open another spreadsheet (call this B) that will always be stored in the same directory as spreadsheet A. Now, at one point during a month, spreadsheets A and B are in one directory, later in the month they gets moved to a history directory. What code do I need to use to have the open always point to the directory that spreadsheet A and B are stored in? Would Curdir be the correct one to use? Is there a way to retrieve the directory path spreadsheet A is contained in, and then use that as part of the Open path for spreadsheet B? TIA for the assistance. Rodg2000 (remove the _nospam to reply) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Robert,
Thanks for the quick response! Exactly what I needed. Rodg2000 "Robert Rosenberg" wrote in message ... Use... Workbooks.Open ThisWorkbook.Path & "\Book2.xls" where ThisWorkbook.Path = the path of spreadsheet A "\Book2.xls" = name of spreadsheet B -- _______________________ Robert Rosenberg R-COR Consulting Services Microsoft MVP - Excel "Rodg2000" wrote in message ... Hi, I'd appreciate help from anyone that can point me in the correct direction here... I want to open a spreadsheet (call this A) that includes a VB macro, and the macro will open another spreadsheet (call this B) that will always be stored in the same directory as spreadsheet A. Now, at one point during a month, spreadsheets A and B are in one directory, later in the month they gets moved to a history directory. What code do I need to use to have the open always point to the directory that spreadsheet A and B are stored in? Would Curdir be the correct one to use? Is there a way to retrieve the directory path spreadsheet A is contained in, and then use that as part of the Open path for spreadsheet B? TIA for the assistance. Rodg2000 (remove the _nospam to reply) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to correct cannot access directory 'J:\\'. | Excel Discussion (Misc queries) | |||
Asterisk pointing to a footnote | Excel Discussion (Misc queries) | |||
Excel pointing me to MS Ofc Install | New Users to Excel | |||
pointing to the c:\ drive | Excel Discussion (Misc queries) | |||
Have a lookup pointing to a CSV file | Excel Programming |