Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Macro problem when sheet protected

I have run into a problem with macros not executing when a sheet is protected
in Excel. I use Office XP.

Any ideas on this?

Thanks,
Les
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Macro problem when sheet protected

Sub MyMacro()
On Error goto ErrHandler
worksheets("Sheet1").Unprotect Password:="ABC"
' current code

ErrHandler:
Worksheets("sheet1").Protect Password:="ABC"
End Sub

--
Regards,
Tom Ogilvy


"WLMPilot" wrote:

I have run into a problem with macros not executing when a sheet is protected
in Excel. I use Office XP.

Any ideas on this?

Thanks,
Les

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Macro problem when sheet protected

Does this code still keep the sheet protected? Also, I have entered macros
before. Is this going to be an EVENT macro?

Thanks,
Les

"Tom Ogilvy" wrote:

Sub MyMacro()
On Error goto ErrHandler
worksheets("Sheet1").Unprotect Password:="ABC"
' current code

ErrHandler:
Worksheets("sheet1").Protect Password:="ABC"
End Sub

--
Regards,
Tom Ogilvy


"WLMPilot" wrote:

I have run into a problem with macros not executing when a sheet is protected
in Excel. I use Office XP.

Any ideas on this?

Thanks,
Les

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Macro problem when sheet protected

It unprotects the sheet while it runs and protects it again at the end.

It is meant to present a concept to integrate with your existing macro.
--
Regards,
Tom Ogilvy


"WLMPilot" wrote:

Does this code still keep the sheet protected? Also, I have entered macros
before. Is this going to be an EVENT macro?

Thanks,
Les

"Tom Ogilvy" wrote:

Sub MyMacro()
On Error goto ErrHandler
worksheets("Sheet1").Unprotect Password:="ABC"
' current code

ErrHandler:
Worksheets("sheet1").Protect Password:="ABC"
End Sub

--
Regards,
Tom Ogilvy


"WLMPilot" wrote:

I have run into a problem with macros not executing when a sheet is protected
in Excel. I use Office XP.

Any ideas on this?

Thanks,
Les

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Macro problem when sheet protected

It unprotects while the macro executes and then protects it again? I am
trying to only have users access certain cells.

The spreadsheet I initially had the problem with was one that a user could
input their paycheck info for a year. Various statistical info was
calculated on the same and other sheets. I had command buttons that were
used to navigate to specific paychecks (if there were three separate incomes
from three jobs) and to navigate to the other sheets.

If my interpretation is correct, is the macro entered as an EVENT?

Thanks,
Les

"Tom Ogilvy" wrote:

It unprotects the sheet while it runs and protects it again at the end.

It is meant to present a concept to integrate with your existing macro.
--
Regards,
Tom Ogilvy


"WLMPilot" wrote:

Does this code still keep the sheet protected? Also, I have entered macros
before. Is this going to be an EVENT macro?

Thanks,
Les

"Tom Ogilvy" wrote:

Sub MyMacro()
On Error goto ErrHandler
worksheets("Sheet1").Unprotect Password:="ABC"
' current code

ErrHandler:
Worksheets("sheet1").Protect Password:="ABC"
End Sub

--
Regards,
Tom Ogilvy


"WLMPilot" wrote:

I have run into a problem with macros not executing when a sheet is protected
in Excel. I use Office XP.

Any ideas on this?

Thanks,
Les



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
Combobox problem in protected sheet Oguz Excel Discussion (Misc queries) 0 March 27th 08 11:26 AM
Problem with Macro/Protected Sheet johncassell[_26_] Excel Programming 2 August 23rd 05 01:43 PM
Macro and Protected Sheet Problem Daniel R. Young Excel Programming 4 July 21st 05 07:32 PM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM
Solver via VBA on protected sheet problem josvr Excel Programming 4 October 2nd 03 02:20 AM


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