ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Protecting sheet that has macro (https://www.excelbanter.com/excel-worksheet-functions/161106-protecting-sheet-has-macro.html)

UB

Protecting sheet that has macro
 
Hi
I am protecting a sheet that has macro, my sheet fives macro error.
But when I unprotect the sheet and run the sheet, there is no error.
Please advise.


terry

Protecting sheet that has macro
 
is the macro altering any of the locked cells on the protected sheet ?

"ub" wrote:

Hi
I am protecting a sheet that has macro, my sheet fives macro error.
But when I unprotect the sheet and run the sheet, there is no error.
Please advise.


UB

Protecting sheet that has macro
 
Yes, it does alter the locked cells

"Terry" wrote:

is the macro altering any of the locked cells on the protected sheet ?

"ub" wrote:

Hi
I am protecting a sheet that has macro, my sheet fives macro error.
But when I unprotect the sheet and run the sheet, there is no error.
Please advise.


terry

Protecting sheet that has macro
 
You could try the tools menu then protection and then the protect sheet tab,
it gives a list of things that it will allow to do on a protected sheet if
your macros preform and of those just put a tick in the box, otherwise all i
can think of is to unlock the cells that are being altered.


"ub" wrote:

Yes, it does alter the locked cells

"Terry" wrote:

is the macro altering any of the locked cells on the protected sheet ?

"ub" wrote:

Hi
I am protecting a sheet that has macro, my sheet fives macro error.
But when I unprotect the sheet and run the sheet, there is no error.
Please advise.


Gord Dibben

Protecting sheet that has macro
 
Change your macro to unprotect, run the routine then re-protect.

Sub runit()

ActiveSheet.Unprotect Password:="justme"

your code runs here

ActiveSheet.Protect Password:="justme"

End Sub


Gord Dibben MS Excel MVP

On Fri, 5 Oct 2007 12:08:04 -0700, ub wrote:

Yes, it does alter the locked cells

"Terry" wrote:

is the macro altering any of the locked cells on the protected sheet ?

"ub" wrote:

Hi
I am protecting a sheet that has macro, my sheet fives macro error.
But when I unprotect the sheet and run the sheet, there is no error.
Please advise.



JP[_3_]

Protecting sheet that has macro
 
Hello,

If you include "ActiveSheet.Protect UserInterfaceOnly:=True" in your
code, you can keep the sheet protected while still allowing the macro
to alter the sheet.


Hope this helps,
JP


On Oct 5, 3:01 pm, ub wrote:
Hi
I am protecting a sheet that has macro, my sheet fives macro error.
But when I unprotect the sheet and run the sheet, there is no error.
Please advise.





All times are GMT +1. The time now is 05:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com