View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Paul Robinson Paul Robinson is offline
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