ransomedbyfire
Board Regular
- Joined
- Mar 9, 2011
- Messages
- 121
I am using the code
to find the user's temp folder.
And then I am using this code to retrieve data from some text files I've written elsewhere in the macro.
But I keep getting errors because Excel insists on putting the quotes from TempFolder right after "TEXT;" when this line of code obviously prefers just to have "TEXT:C:\....", Destination.... etc.
What can I do to fix this?
Thanks!
Code:
Set oFS = New FileSystemObject
TempFolder = oFS.GetSpecialFolder(TemporaryFolder)
And then I am using this code to retrieve data from some text files I've written elsewhere in the macro.
Code:
For filenum = 1 To symbols
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & TempFolder & "\MyFileName" & filenum & ".CSV", Destination:=Sheet1.Cells(2, filenum + 1))
.Refresh BackgroundQuery:=False
End With
Next filenum
What can I do to fix this?
Thanks!