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

I'm converting a workbook to 2007 from 2003. Luckily all the code
seems to work except for saving the file. From looking through the
help files it seems that the ActiveWorkbook.Save command should be
just fine. I'm not sure what else to try. The error message is : "Run-
time error '1004': Method 'Save' of object '_Workbook' failed".

Suggestions please? Code below.

Private Sub CommandButton1_Click()
ActiveSheet.Unprotect
Sheet1.ClearTotals
Call Sheet1.ClearOrder
Worksheets("Order Form").Activate
ActiveSheet.Protect
ActiveWorkbook.Save
Application.DisplayAlerts = False
Application.Quit
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Save failing

Activeworkbook.save is correct for XL2003.

Is this workbook being opened from an email attachment, a local drive, or a
network drive?

Is the file marked or opened as read-only?

What happens when you try to save the file normally (without using a macro)-
does Excel pop up any dialogue boxes of any kind? If your macro opens the
file, put a breakpoint in and then try to save the file manually just to make
sure the rest of the scenario is identical.

What is the file extension of the file? (XLS, XLSX, XLSM, etc)


"Jennifer" wrote:

I'm converting a workbook to 2007 from 2003. Luckily all the code
seems to work except for saving the file. From looking through the
help files it seems that the ActiveWorkbook.Save command should be
just fine. I'm not sure what else to try. The error message is : "Run-
time error '1004': Method 'Save' of object '_Workbook' failed".

Suggestions please? Code below.

Private Sub CommandButton1_Click()
ActiveSheet.Unprotect
Sheet1.ClearTotals
Call Sheet1.ClearOrder
Worksheets("Order Form").Activate
ActiveSheet.Protect
ActiveWorkbook.Save
Application.DisplayAlerts = False
Application.Quit
End Sub
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Save failing

And if you save that workbook manually, do you get any errors?

Jennifer wrote:

I'm converting a workbook to 2007 from 2003. Luckily all the code
seems to work except for saving the file. From looking through the
help files it seems that the ActiveWorkbook.Save command should be
just fine. I'm not sure what else to try. The error message is : "Run-
time error '1004': Method 'Save' of object '_Workbook' failed".

Suggestions please? Code below.

Private Sub CommandButton1_Click()
ActiveSheet.Unprotect
Sheet1.ClearTotals
Call Sheet1.ClearOrder
Worksheets("Order Form").Activate
ActiveSheet.Protect
ActiveWorkbook.Save
Application.DisplayAlerts = False
Application.Quit
End Sub


--

Dave Peterson
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
Failing IF Statement Jemsilve Excel Discussion (Misc queries) 2 November 9th 07 09:23 PM
event failing Curt Excel Programming 1 November 5th 07 08:05 PM
My formulas are failing! Excel_Orator Excel Discussion (Misc queries) 3 June 12th 06 08:16 PM
FollowHyperlink failing Andrew Fiddian-Green Excel Programming 0 January 9th 06 11:59 AM
Link 'failing' ppetts Links and Linking in Excel 1 October 5th 05 06:20 AM


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