Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 215
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 215
Default Identify Full Path of Opened Excel Workbook

Bob, Dana, Tim, Tom;

Very helpful! Thank you all.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to see full path name of open workbook? Joe User[_2_] Excel Discussion (Misc queries) 5 March 21st 10 08:29 PM
Identify the network path a file was opened from (Excel2007) DataBoy Excel Discussion (Misc queries) 2 September 25th 09 03:33 PM
How to Display Full Path for File Diplayed at Top Of Workbook XRacr Excel Discussion (Misc queries) 1 February 1st 07 08:41 PM
full path of excel file Song Excel Discussion (Misc queries) 2 August 21st 05 06:50 PM
How to get the full path name of the open workbook in a macro Flystar[_10_] Excel Programming 3 May 13th 04 09:16 AM


All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"