Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default SaveAs Error

Hello,

I am getting the following error when trying to save a file as a CSV file:

run-time error '1004': Method 'SaveAs" of object'_Workbook' failed

I found the following workaround (see below), but I am building this
application for other people and this solution is not an option.

Any help with this would be appreciated.

--
Thanks in advance,

Steven


http://www.kbalertz.com/kb_Q199268.aspx
To work around this problem, unlock the workbook before running the macro.
To do this, follow these steps:

Open the workbook that you are trying to save as text.
Press ALT+F11 to open the Visual Basic Editor.
On the Tools menu, click VBAProject Properties, and then click the
Protection tab.
Click to clear the Lock project for viewing check box. Click OK.
On the File menu, click Save. Press ALT+Q to return to Excel.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SaveAs Error

Activesheet.copy
Application.DisplayAlerts = False
Activeworkbook.Saveas "C:\MyFile.csv"
Application.DisplayAlerts = True
ActiveWorkbook.Close Savechanges:=False

--
Regards,
Tom Ogilvy

"Steven K" wrote in message
...
Hello,

I am getting the following error when trying to save a file as a CSV file:

run-time error '1004': Method 'SaveAs" of object'_Workbook' failed

I found the following workaround (see below), but I am building this
application for other people and this solution is not an option.

Any help with this would be appreciated.

--
Thanks in advance,

Steven


http://www.kbalertz.com/kb_Q199268.aspx
To work around this problem, unlock the workbook before running the macro.
To do this, follow these steps:

Open the workbook that you are trying to save as text.
Press ALT+F11 to open the Visual Basic Editor.
On the Tools menu, click VBAProject Properties, and then click the
Protection tab.
Click to clear the Lock project for viewing check box. Click OK.
On the File menu, click Save. Press ALT+Q to return to Excel.




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
SaveAs method error Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 October 6th 09 09:05 PM
error message with saveas DJA Excel Discussion (Misc queries) 6 February 17th 05 06:03 PM
Error on ActiveWorkbook.SaveAs method cruisy Excel Programming 3 May 17th 04 08:40 AM
Error on ActiveWorkbook.SaveAs method Tim Zych[_8_] Excel Programming 0 May 17th 04 06:33 AM
Error on SaveAs Macro Kevin Excel Programming 1 December 3rd 03 03:58 AM


All times are GMT +1. The time now is 03:43 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"