SaveAs Filename:=filename, FileFormat:=xlCSV

T

Teddy

Hi

There is aparently a bug in excel


When I save my workbook with the code
SaveAs Filename:=filename, FileFormat:=xlCSV
I get too many separators!
The first rows is with wrong number of fields

The parameter local is not involved - tried to set it but no result.

There are emty cells from C1 (col 3) to IV1 (col 255)
There are emty cells from H1 (col 8) to IV2 (col 255)
and so on

But not on all rows as you see..
Is there a way out of this?

*BOF*
field1;field2;;;;;
field1;field2;field3;field4;field5;field6;field7
field1;field2;field3;field4;field5;field6;field7
field1;field2;field3;field4;field5;field6;
field1;field2;;;;;
field1;;;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3;;;;
field1;field2;field3
field1;field2;field3
field1;field2;field3
field1;field2;field3
field1;field2;field3
field1;field2;field3
field1;;
*EOF*


Best regards Ted
 
D

Dave Peterson

Saved from a previous post:

This might describe the problem of too many commas in CSV files:

http://support.microsoft.com/default.aspx?scid=77295
Column Delimiters Missing in Spreadsheet Saved as Text

(It actually describes missing delimiter, but if some are "missing", maybe the
ones appearing are "extra".)

(But a lot of programs (excel included) don't care about those extra columns.
Maybe you don't have to care, either???)

Maybe you could write your own exporting program that would behave exactly the
way you want:

Here are three sites that you could steal some code from:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

(or maybe you could build your own formula and copy|paste into Notepad.)
 

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