Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jean Cloutier
 
Posts: n/a
Default Allow user to run a macro in protected mode

I want to let other users of my spreadsheet to run a macro in protected mode.

The macro runs the filter for a big spreadsheet and I want to keep the
protection on but let users run the simple macro that hides the blank lines
with auto-filters.

Users get Run-time error 1004 when they click on my macro icon
  #2   Report Post  
Posted to microsoft.public.excel.misc
goober
 
Posts: n/a
Default Allow user to run a macro in protected mode


The cells you are manipulating have to be unprotected during the
manipulation.

You can do this by putting this piece of code at the beginning of your
macro.

Dim Code
Code = "password"
Worksheets("sheetname).Unprotect (PrivCode)

Then at the end of your code put this

Worksheets("sheetname).Protect (PrivCode)

You will have to password protect your VBA editor for that Workbook but
this will allow the macro to change the sheet as it needs to.


--
goober
------------------------------------------------------------------------
goober's Profile: http://www.excelforum.com/member.php...o&userid=19838
View this thread: http://www.excelforum.com/showthread...hreadid=487761

  #3   Report Post  
Posted to microsoft.public.excel.misc
dominicb
 
Posts: n/a
Default Allow user to run a macro in protected mode


Good evening Jean Cloutier

You should be able to run a macro in a protected sheet. The error will
be caused by attempting to filter items in a protected sheet.

If you are using Excel 2002 or higher, you can set the filter to run in
a protected sheet from the protection dialog.

If you are using XL2000 or prior, then look here to see how to handle
filters in a protected sheet:

http://www.contextures.com/xlautofilter03.html#Protect

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=487761

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
Can T Get Macro To Run! Nipper New Users to Excel 2 November 4th 05 04:48 AM
How do I write a macro for a button to send user to a custom view? Hugnuffer Excel Discussion (Misc queries) 1 August 16th 05 06:34 PM
Cells User Select Locked after upgrade to Excel 2002 TWilson Excel Discussion (Misc queries) 1 August 5th 05 12:22 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Unable to open excel sheet in Protected mode from VB 6.0 ourspt Setting up and Configuration of Excel 0 January 26th 05 11:07 AM


All times are GMT +1. The time now is 05:04 PM.

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"