ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening a File (https://www.excelbanter.com/excel-programming/292937-opening-file.html)

ronbo

Opening a File
 
I need a way to activate a workbook. I am in the open
workbook that has a 8 character file name 1234.xls. The
workbook I would like to activate is the same name, less
2 characters in the name or 12.xls. I have been trying
the following but neither work

TmpName2 = Left(ActiveWorkbook.Name, Len
(ActiveWorkbook.Name) - 6)

Workbooks.Open ("C:\ path\" & tmpName2 & ".xls")

Or

Windows("tmpName.xls").Activate

Any help would be appreciated.





All times are GMT +1. The time now is 10:12 AM.

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