Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA SaveAs function generates blank CSV file

This is a very simple line and it just doesn't work. What it did is just creating a blank csv file with nothing in it (the file name is correct though).


ActiveWorkbook.SaveAs Filename:="C:\temp\test" & ".csv", _
FileFormat:=xlCSV, CreateBackup:=False


And it only happens on one PC. The other PCs runs it perfectly. Can anyone tell why?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default VBA SaveAs function generates blank CSV file

All PC's are the same version of Excel? It's possible that on the
problem PC the active workbook is not what you think it is...

Tim

On Sep 29, 9:38*pm, Shaoqing Chen wrote:
This is a very simple line and it just doesn't work. What it did is just creating a blank csv file with nothing in it (the file name is correct though).

* * ActiveWorkbook.SaveAs Filename:="C:\temp\test" & ".csv", _
* * * * FileFormat:=xlCSV, CreateBackup:=False

And it only happens on one PC. The other PCs runs it perfectly. Can anyone tell why?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA SaveAs function generates blank CSV file

I am not sure what you mean. I tried restarting excel and only opening one workbook and it was still the same thing.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default VBA SaveAs function generates blank CSV file

Saving a workbook as a CSV file saves only the activesheet.

Maybe the sheet that's active is empty?



On 09/29/2011 23:38, Shaoqing Chen wrote:
This is a very simple line and it just doesn't work. What it did is just creating a blank csv file with nothing in it (the file name is correct though).


ActiveWorkbook.SaveAs Filename:="C:\temp\test"& ".csv", _
FileFormat:=xlCSV, CreateBackup:=False


And it only happens on one PC. The other PCs runs it perfectly. Can anyone tell why?


--
Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA SaveAs function generates blank CSV file

No it definitely was not empty. The save to xsl worked fine.

The most stupid thing is, after this line executed I can see the title of the workbook changed to test.csv with full data in it. But when I get out of excel and open the file with notepad it is all empty.

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
ActiveWorkbook.SaveAs Function - Can I specify the user account tosave the file with TyreDude[_2_] Excel Programming 6 January 26th 10 05:32 AM
"SaveAs" Generates error on shared drive RWN Excel Programming 2 April 23rd 05 03:15 AM
How do I reference my current file in saveas function? BrookStevenson Excel Programming 1 March 22nd 05 08:10 PM
workbook saveas function, xlText file format Massimo Bassini[_2_] Excel Programming 3 January 26th 05 04:05 PM
overwrite Excel SaveAs function from File menu susie Excel Programming 1 July 31st 03 04:47 AM


All times are GMT +1. The time now is 11:57 AM.

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"