View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Convert Excel to text in VB6

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

--
Regards,
Tom Ogilvy

"JT" wrote in message
...
How to save an Excel file to a Text using Visual basic 6.0
Can we get examples?

Thanks