D
David
Hi,
I'm using Excel 2003 sp3. I've written a vba macro to import text
from a text file :
Sub Create_excel()
Dim WS As Worksheet
Dim QT As QueryTable
Set WS = Worksheets("Sheet1")
Set QT = WS.QueryTables.Add("TEXT;C:\temp\tmp.csv", WS.Range("A1"))
QT.TextFileSpaceDelimiter = True
QT.Refresh 'BackgroundQuery:=False
QT.Delete
End Sub
The first time I run it it runs fine. But the next time the data gets
appended adjacent to the last cell that was written on the previous run, and
not A1. Also even if I modify the text file and and re-run the changes don't
take effect. Can anyone help ?
Thanks.
-david.
I'm using Excel 2003 sp3. I've written a vba macro to import text
from a text file :
Sub Create_excel()
Dim WS As Worksheet
Dim QT As QueryTable
Set WS = Worksheets("Sheet1")
Set QT = WS.QueryTables.Add("TEXT;C:\temp\tmp.csv", WS.Range("A1"))
QT.TextFileSpaceDelimiter = True
QT.Refresh 'BackgroundQuery:=False
QT.Delete
End Sub
The first time I run it it runs fine. But the next time the data gets
appended adjacent to the last cell that was written on the previous run, and
not A1. Also even if I modify the text file and and re-run the changes don't
take effect. Can anyone help ?
Thanks.
-david.