Saving an Excel file as text

H

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top