LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Automatic CSV saving pains - unwanted rows and columns

Hi, I'm currently using a macro to prompt a user to save a sheet as a CSV
file. I already have code in place that hides all the unwanted cells and
whilst the CSV file saves perfectly when done manually, looking like this:

asf,adsff,fsdf
gtre,ffdf,etth

when I run the appropriate part of the code, which is this:

Do
fname = Application.GetSaveAsFilename(fileFilter:="CSV files (*.csv), *.csv")
Loop Until fname < False
Workbooks(newreport).SaveAs Filename:=fname, FileFormat:=xlCSV,_
CreateBackup:=False, Local:=True

Workbooks(fname).Saved = True
Workbooks(fname).Close

it produces a CSV file that looks like this:

asaf,dsdf,fadsf,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
fdsd,fdsf,fdsf,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,

I just can't figure out why this is happening, even if I go and actually
record the code there appears to be no differences.. Can any one help?

Thanks in advance!
 
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
WHY IS FREEZE PAINS GREYED OUT scamander Excel Discussion (Misc queries) 7 April 4th 10 01:59 AM
Unwanted Prompt When Saving a Protected Sheet in 2007 faraway Excel Discussion (Misc queries) 0 May 6th 09 12:46 PM
Unwanted cells at end of document rows and columns Big Dog[_2_] Excel Discussion (Misc queries) 4 November 10th 08 07:58 PM
Excel 2003 unwanted automatic Text to Columns Hollie C[_2_] Setting up and Configuration of Excel 4 April 8th 08 10:42 PM
Unwanted Automatic Link Update slreilly Excel Discussion (Misc queries) 0 December 11th 07 04:42 PM


All times are GMT +1. The time now is 08:48 AM.

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

About Us

"It's about Microsoft Excel"