Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Open file specified in Excel cell

Status
Not open for further replies.

XLnew

Computer
Dec 21, 2008
12
0
0
US
Hello All,

I have a rather silly question on VBA/Excel:

In Excel, I have a sheet name specified in cell A1. Say the content of A1 reads myXLworkbook.xls

Now, what I would like to do is open this workbook (myXLworkbook.xls) from VBA. Currently, I use:

Workbooks.Open Filename:="X:\myXLworkbook.xls"

However, this is not excatly what I want, since, I would like to change the contents of cell A1 to say myXLworkbook2.xls and would want VBA to now open this workbook.

How does one achieve this?

I hope my question is clear.

Best Wishes,

XLNew
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top