Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Opening workbook in same directory

Is the only way to open another workbook programatically from the workbook
that is currently open to use the Workbooks.Open filename:= command to supply
the path and the workbook name? Is there any way you can open another
workbook that resides in the same directory without supply the path?

Thanks much.

Andy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Opening workbook in same directory

You don't need to hard code the path. Use something like:

fname = "something.xls"
Workbooks.Open Filename:=ThisWorkbook.Path & "\" & fname

--
Gary''s Student - gsnu200765


"Andyjim" wrote:

Is the only way to open another workbook programatically from the workbook
that is currently open to use the Workbooks.Open filename:= command to supply
the path and the workbook name? Is there any way you can open another
workbook that resides in the same directory without supply the path?

Thanks much.

Andy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Opening workbook in same directory

Wow.. Good answer. Thanks

"Gary''s Student" wrote:

You don't need to hard code the path. Use something like:

fname = "something.xls"
Workbooks.Open Filename:=ThisWorkbook.Path & "\" & fname

--
Gary''s Student - gsnu200765


"Andyjim" wrote:

Is the only way to open another workbook programatically from the workbook
that is currently open to use the Workbooks.Open filename:= command to supply
the path and the workbook name? Is there any way you can open another
workbook that resides in the same directory without supply the path?

Thanks much.

Andy

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
Change current directory to the directory that the workbook loads from! alondon Excel Programming 5 April 17th 07 06:05 AM
Opening a directory using code Robert Pollock[_3_] Excel Programming 1 January 27th 05 02:06 PM
opening directory from excel Pradyumna. Excel Programming 1 June 16th 04 01:27 PM
opening directory from excel Pradyumna Excel Programming 1 June 16th 04 12:01 PM
opening a workbook in the current directory Richard[_16_] Excel Programming 2 August 30th 03 02:46 AM


All times are GMT +1. The time now is 09:56 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"