A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

SaveAs Filename:=filename, FileFormat:=xlCSV



 
 
Thread Tools Display Modes
  #1  
Old May 29th 07, 01:49 PM posted to microsoft.public.excel.programming
Teddy[_3_]
external usenet poster
 
Posts: 8
Default SaveAs Filename:=filename, FileFormat:=xlCSV

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

Ads
  #2  
Old May 29th 07, 02:05 PM posted to microsoft.public.excel.programming
Dave Peterson
external usenet poster
 
Posts: 35,218
Default SaveAs Filename:=filename, FileFormat:=xlCSV

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.)

Teddy wrote:
>
> 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


--

Dave Peterson
  #3  
Old May 29th 07, 02:34 PM posted to microsoft.public.excel.programming
Teddy[_3_]
external usenet poster
 
Posts: 8
Default SaveAs Filename:=filename, FileFormat:=xlCSV

Hi Dave

:-) Great. Thanks a lot!

Best regards Ted


On 29 Maj, 15:05, Dave Peterson > wrote:
> 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.)
>
>
>
>
>
> Teddy wrote:
>
> > 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

>
> --
>
> Dave Peterson- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SaveAs Filename and FileFormat in Vs2007 RobN[_2_] Excel Discussion (Misc queries) 4 July 14th 07 01:21 AM
SaveAs filename PDF kidkarma Excel Programming 2 March 8th 07 08:25 AM
FileFormat:=xlCSV for a cell with =TODAY() gives unwantedamerican Crewman Excel Programming 4 March 5th 05 06:18 PM
FileName SaveAs alanford Excel Programming 1 February 18th 05 01:01 PM
SaveAs Filename Help Ed[_14_] Excel Programming 2 November 20th 03 07:43 PM


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


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