Home All Groups Group Topic Archive Search About

Saving an Excel file as text

Author
31 May 2006 10:30 PM
herman404
Hi everyone, I have a script that saves an excel worksheet as a CSV
file. However, I need to save it as a tab delimited text file, since
csv won't work for our purposes, because of commas in the numeric
amounts passed in. A sample of our script is below, and I need to know
the constant to save as a tab delimited text instead.

Thanks,

Code:
Const xlCSV = 6

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\Testsheet.xls")
objExcel.DisplayAlerts = FALSE
objExcel.Visible = TRUE

Set objWorksheet = objWorkbook.Worksheets("Sheet1")
objWorksheet.SaveAs "c:\scripts\test.csv", xlCSV

objExcel.Quit

Author
1 Jun 2006 12:56 AM
Arthur
objWorksheet.SaveAs "c:\scripts\test.txt", xlText