Run-Time Error 1004

whudson1980

New Member
Joined
Dec 10, 2013
Messages
13
Hello All, and happy belated Thanksgiving,

I have a workbook with about 20 sheets, most of which are protected.

I have a Main sheet with a "Log In" command button, and based on what password you enter, you're given access to certain sheets.

With that said, it all runs perfectly. And I have a BeforeSave sub that runs protections and basically "logs you out."

I tried making a Sub Called SaveAndLogout which simply does a "ActiveWorkbook.Save" for the purpose of saving when I have the ribbon hidden. But it returns "Run-Time Error 1004: The cell or chart that you are trying to change is protected and therefore read-only."

Why would the save button in the ribbon work just fine, but the ActiveWorkbook.Save throw this error?

Any ideas? I really want to hide the ribbon, which also (unfortunately) hides the save icon. :)
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Also, just for the record, I did search the forum first. I found a few articles here and online referencing the Run Time error, but it seems that none of scenarios fit mine. It just seems that the VBA code to save the sheet is also trying to modify cells. Not sure.
 
Upvote 0
How about adding the save icon to the QAT?
 
Upvote 0
Not sure why you'd get the error, from activeworkbook.save but not from the save icon.
Another possible option (if available in 2007) press Ctrl F1 this will minimise the ribbon rather than hiding it.
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,664
Members
449,114
Latest member
aides

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top