Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
UB UB is offline
external usenet poster
 
Posts: 120
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
UB UB is offline
external usenet poster
 
Posts: 120
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default 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.



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
Protecting a macro DannyS Excel Discussion (Misc queries) 4 September 5th 07 02:38 PM
Can't use tab after protecting sheet. tonyia Excel Worksheet Functions 0 March 21st 06 03:57 PM
Protecting Sheet purplerayn Excel Worksheet Functions 1 October 21st 05 12:55 AM
macro for Protecting a Sheet cincode5 Excel Discussion (Misc queries) 5 July 20th 05 11:59 AM
Can't use tab after protecting sheet. snam Excel Discussion (Misc queries) 3 January 21st 05 02:54 PM


All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"