View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Macro to open Workbook in default path.

Richard,

Try something like

Dim PathA As String
PathA = Workbooks("BookA.xls").Path
Workbooks.Open Filename:=PathA & "\" & "BookB.xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Richard" wrote in message
...
OS: MS XP
Excel: 2002

I have (2) two workbooks in the same directory. One workbook opens the
other.
The (2) two workbooks will always be together in the same directory but on
occasions the directory will change.

Is there a way in a macro to always use the path of workbook A to open
workbook B?

Thanks in advance.


--
Richard