Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default how to open workbook without hardcoding path

Hi

Could anyone tell me how to open a workbook from another workbook, where
both files are in the same folder, without hardcoding the path. I have tried
code like this without success.
Workbooks.open (path & "\somefile.xls")

Thanks in advance
Mick


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default how to open workbook without hardcoding path

Hi Michael,

Workbooks.open (path & "\somefile.xls")


Workbooks.open thisworkbook.path & "\somefile.xls"

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default how to open workbook without hardcoding path

Hi Mick

Youre sooo close:
Workbooks.Open ThisWorkbook.Path & "\somefile.xls"

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Michael Turner" skrev i melding
...
Hi

Could anyone tell me how to open a workbook from another workbook, where
both files are in the same folder, without hardcoding the path. I have

tried
code like this without success.
Workbooks.open (path & "\somefile.xls")

Thanks in advance
Mick




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default how to open workbook without hardcoding path

Hi,
Try
Workbooks.open (ThisWorkbook.path & "\somefile.xls")

ThisWorkbook in VBA is the one containing the code.

regards
Paul

"Michael Turner" wrote in message ...
Hi

Could anyone tell me how to open a workbook from another workbook, where
both files are in the same folder, without hardcoding the path. I have tried
code like this without success.
Workbooks.open (path & "\somefile.xls")

Thanks in advance
Mick

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
my vlookup path changes when I open the file AliGoLightly Excel Worksheet Functions 1 February 23rd 09 09:52 PM
How to find file-path of open workbook? Larryq22 Excel Discussion (Misc queries) 7 January 24th 08 03:38 AM
Macro to open Workbook in default path. Richard Excel Discussion (Misc queries) 2 October 7th 07 02:24 PM
Checking if workbook open (where path is unknown) [email protected] Excel Programming 0 September 4th 03 11:13 PM


All times are GMT +1. The time now is 09:07 PM.

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"