Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Save a workbook using FileFormat in .txt but with data in csv for

Hi all,
I have a workbook with data in rows and columns and I want to save it as a
csv text file but with a .txt extension and not a .csv extension. This .txt
file is then read by another programm.
If I save it with the Excel available .txt extensions, the txt file produced
is always a tab file.
The only code that produces the format I am looking for is:
ActiveWorkbook.SaveAs filename:=Range("A3").Value, FileFormat:=xlCSV,
CreateBackup:=False
ChDir "C:\Documents and Settings\Administrador\Escritorio"
but the file produced is with a .csv extension and what I want is a .txt
I really need to produce it direct and not have to use the Office rename
function.
Any ideas? Thks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Save a workbook using FileFormat in .txt but with data in csv for

Yves,

If your Range("A3") ends in ".txt" or you change the line saving to;

ActiveWorkbook.SaveAs filename:=Range("A3").Value & ".txt",
FileFormat:=xlCSV, CreateBackup:=False

That wil force the filename to finish .txt not .csv

Regards,

Chris.

--
Chris Marlow
MCSD.NET, Microsoft Office XP Master


"Yves" wrote:

Hi all,
I have a workbook with data in rows and columns and I want to save it as a
csv text file but with a .txt extension and not a .csv extension. This .txt
file is then read by another programm.
If I save it with the Excel available .txt extensions, the txt file produced
is always a tab file.
The only code that produces the format I am looking for is:
ActiveWorkbook.SaveAs filename:=Range("A3").Value, FileFormat:=xlCSV,
CreateBackup:=False
ChDir "C:\Documents and Settings\Administrador\Escritorio"
but the file produced is with a .csv extension and what I want is a .txt
I really need to produce it direct and not have to use the Office rename
function.
Any ideas? Thks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I save a workbook(2007) w/ a data connection to htm no data? Robert Excel Discussion (Misc queries) 0 July 13th 09 01:39 AM
save data in another workbook Buddy Lee Excel Programming 1 November 22nd 05 08:20 PM
Too much data to save a workbook Tobie Hanekom New Users to Excel 0 May 16th 05 08:55 AM
save format & data to new workbook Tom Ogilvy Excel Programming 0 September 15th 04 12:38 PM
Save Workbook using List Box Data Full Monty[_4_] Excel Programming 5 February 9th 04 09:20 PM


All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"