Convert Excel to text in VB6

  • Thread starter Thread starter JT
  • Start date Start date
Dim xlApp as Object
Dim xlBk as Object
set xlApp = CreateObject("Excel.Application")
set xlBk = xlApp.workbooks.Open("C:\My Folder\MyFile.xls")
On error resume next
kill "C:\My Folder\MyTextFile.CSV"
On Error goto 0
xlBk.SaveAs "C:\My Folder\MyTextFile.csv", 6 ' xlCSV = 6
xlbk.Close Savechanges:=False
set xlbk = Nothing
xlApp.Quit
set xlApp = Nothing
 
Back
Top