Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filename as variable from textbox 1

Status
Not open for further replies.

MrsTFB

MIS
Oct 3, 2000
307
US
I have the following code to open an Excel97 file with data imported from a Labview Data Acquisition program. It works beautifully to open the file, however, (There is ALWAYS an HOWEVER), I want to be able to prompt for the filename. In this case it is 092601, which will be the date, and allow the user to enter this. With all the existing code staying the same. I know I can name the filename a variable but with the 10Tank2_ portion being constant and only the date changing. Any ideas?!?!

Workbooks.OpenText FileName:="G:\QAProdDataAcq\10Tank2_092601.xls", Origin _
:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1))


Thanks for any ideas,
Bsimm GO TITANS
 
I thought I was in the Excel forum, SORRY! I am going to replace this question in the Excel forum.

It's a blonde moment!! Yes, I am blonde!

Bsimm :p
 
You can make just a portion of you filename a variable.

Take the Filename portion and set it to something like this:


myName = WHATEVER THE USER ENTERS
FileName = "G:\QAProdDataAcq\10Tank2_" & myName & ".xls"


I hope this helps.
 
Looks perfect, can't wait to try it. Thanks for your quick response!!!


Bsimm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top