Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Full Path of Opened Excel Workbook
In a VBA Excel macro, how can I identify the full path of "this" opened
workbook test1.xls, and then use it to open another file test2.xls at the same location ? Will the procedure change the current folder in the File menu ? Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Full Path of Opened Excel Workbook
Activeworkbook.Path
-- HTH RP (remove nothere from the email address if mailing direct) "monir" wrote in message ... In a VBA Excel macro, how can I identify the full path of "this" opened workbook test1.xls, and then use it to open another file test2.xls at the same location ? Will the procedure change the current folder in the File menu ? Thank you. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Full Path of Opened Excel Workbook
Here's one of a few ways:
Sub Demo() Dim v Dim WbToOpen Dim ps As String ps = Application.PathSeparator v = Split(ThisWorkbook.FullName, ps) v(UBound(v)) = "Test2.xls" WbToOpen = Join(v, ps) ' etc... End Sub HTH -- Dana DeLouis Win XP & Office 2003 "monir" wrote in message ... In a VBA Excel macro, how can I identify the full path of "this" opened workbook test1.xls, and then use it to open another file test2.xls at the same location ? Will the procedure change the current folder in the File menu ? Thank you. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Full Path of Opened Excel Workbook
workbooks.open thisworkbook.path & "\test2.xls"
Tim "monir" wrote in message ... In a VBA Excel macro, how can I identify the full path of "this" opened workbook test1.xls, and then use it to open another file test2.xls at the same location ? Will the procedure change the current folder in the File menu ? Thank you. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Full Path of Opened Excel Workbook
sPath = Activeworkbook.Path
-- Regards, Tom Ogilvy "monir" wrote in message ... In a VBA Excel macro, how can I identify the full path of "this" opened workbook test1.xls, and then use it to open another file test2.xls at the same location ? Will the procedure change the current folder in the File menu ? Thank you. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify Full Path of Opened Excel Workbook
Bob, Dana, Tim, Tom;
Very helpful! Thank you all. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to see full path name of open workbook? | Excel Discussion (Misc queries) | |||
Identify the network path a file was opened from (Excel2007) | Excel Discussion (Misc queries) | |||
How to Display Full Path for File Diplayed at Top Of Workbook | Excel Discussion (Misc queries) | |||
full path of excel file | Excel Discussion (Misc queries) | |||
How to get the full path name of the open workbook in a macro | Excel Programming |