ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to open workbook from template without hardcoding (https://www.excelbanter.com/excel-programming/283170-how-open-workbook-template-without-hardcoding.html)

Michael Turner

How to open workbook from template without hardcoding
 
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")




Steve Garman

How to open workbook from template without hardcoding
 
Michael Turner wrote:

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")


Have you tried
Workbooks.open ("somefile.xls")


--
Steve Garman


Ron de Bruin

How to open workbook from template without hardcoding
 
You can use this

ThisWorkbook.Path

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Michael Turner" wrote in message ...
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")







All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com