Define variable from cell to open a file

G

Guest

I am trying to open a file that has a date in its name. EX Data-20070816.csv

I have the user input the date in one cell (a1) and have a string formula in
another cell (b1).

I keep getting an error when I try to define the variable.


Windows("Data Comparison.xls").Activate
Application.Run "BLPLinkReset"
Sheets("Sheet1").Select

Dim Filename As String
Set Filename = Range("A1").Select

Workbooks.Open Filename:="V:\FTP Data\(Filename)"
 
G

Guest

Yes the file exists. I have strFilename1X.

Jim Thomlinson said:
Where does the 1X come from. By prefixing FileName with "str" we get aound
the reserved word issue.

Does a file exist such as
V:\FTP Data\Data-20070816.csv
 
G

Guest

Where does the 1X come from. By prefixing FileName with "str" we get aound
the reserved word issue.

Does a file exist such as
V:\FTP Data\Data-20070816.csv
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top