Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro for saving an Excel file as Text (.txt)

Status
Not open for further replies.

collierd

MIS
Dec 19, 2001
509
DE
Hello

I am using MS Excel 2003

with vb I have a macro the key part being:

Code:
ActiveWorkbook.SaveAs "c:\Benchmark_Gross_Profit_Feed.txt"

This saves the excel spreadsheet as Benchmark_Gross_Profit_Feed.txt in my c directory

The problem is, when I open this, it's complete garbage!

Yet, if I manually save the spreadheet as Benchmark_Gross_Profit_Feed specifying Text (Tab Delimited) as the format the resultant file is perfectly legible

Any ideas what causes this?
Are there some additional parameters I should be using?


Thanks

Damian.
 
collierd,

Code:
   ActiveWorkbook.SaveAs Filename:="C:\test\Book1.txt", FileFormat:=xlText, _
        CreateBackup:=False
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top