J
JillE
Hi,
I'm trying to export data from Excel to a text file using the open statement.
My problem is that I have to create multiple files using some of the data
itself to make up the file name. I can get the basic functionality to work
and have used it before but haven't had any luck inserting variables for the
filename itself.
I can't find any documentation that specifically states it's possible or not
possible but I haven't found any examples either.
No matter what variation I try, I get a bad file name error.
Here's the code I'm using:
vFilename = vInternalExternal & "-" & vLastName4Char & "-" & vAdNumber & "-"
& vDateTime & "-" & vRequistionNumber & ".txt"
vFullFilename = ActiveWorkbook.Path & vFilename
Open vFullFilename For Append As #1
Print #1, vAllFields
Close #1
Any thoughts would be appreciated.
Thanks
I'm trying to export data from Excel to a text file using the open statement.
My problem is that I have to create multiple files using some of the data
itself to make up the file name. I can get the basic functionality to work
and have used it before but haven't had any luck inserting variables for the
filename itself.
I can't find any documentation that specifically states it's possible or not
possible but I haven't found any examples either.
No matter what variation I try, I get a bad file name error.
Here's the code I'm using:
vFilename = vInternalExternal & "-" & vLastName4Char & "-" & vAdNumber & "-"
& vDateTime & "-" & vRequistionNumber & ".txt"
vFullFilename = ActiveWorkbook.Path & vFilename
Open vFullFilename For Append As #1
Print #1, vAllFields
Close #1
Any thoughts would be appreciated.
Thanks