Identify Full Path of Opened Excel Workbook

G

Guest

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.
 
B

Bob Phillips

Activeworkbook.Path

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
D

Dana DeLouis

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top