I'm a bit stuck on this one.
I've imported data from a text file into Excel using the below code.
where sFullName is the full path and name of the file.
When I go to save the data back to sFullName,
I get an error message indicating the file is still open.
How can I close the file after importing the data?
Here's the code:
Thanks,
John
In Annapolis, MD
I've imported data from a text file into Excel using the below code.
where sFullName is the full path and name of the file.
When I go to save the data back to sFullName,
I get an error message indicating the file is still open.
How can I close the file after importing the data?
Here's the code:
Code:
'-- Import the Text File ----------------------------------------------
With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & _
sFullName, _
Destination:=wsData.Range("$A$1"))
.Name = sName
.FieldNames = True
.RowNumbers = False
.
.
End With
John
In Annapolis, MD