Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Sheet Protection

Hi. I have a macro that is activated on any Worksheet
Change. I would like to protect this sheet so that the
user will only enter data in the appropriate cells. When
I protect the sheet, however, I get an application
error. The application error occurs when the macro
attempts to delete a shape ...

Any ideas?

Thanks,
Mike.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Sheet Protection

Mike,

Use the UserInterfaceOnly parameter when you protect the sheet.
This allows VBA code to do anything to the sheet; it only
protects against use action with the keyboard and mouse. E.g.,

Worksheets(1).Protect UserInterfaceOnly:=True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Mike" wrote in message
...
Hi. I have a macro that is activated on any Worksheet
Change. I would like to protect this sheet so that the
user will only enter data in the appropriate cells. When
I protect the sheet, however, I get an application
error. The application error occurs when the macro
attempts to delete a shape ...

Any ideas?

Thanks,
Mike.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sheet Protection

Protect your worksheets with code with userfaceonly like this
Place this in the Thisworkbook module.

The macro's will be working now
It will only protect the userfaceonly

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel

Private Sub Workbook_Open()
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
sh.Protect "ABCD", , , userinterfaceonly:=True
Next sh
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Mike" wrote in message ...
Hi. I have a macro that is activated on any Worksheet
Change. I would like to protect this sheet so that the
user will only enter data in the appropriate cells. When
I protect the sheet, however, I get an application
error. The application error occurs when the macro
attempts to delete a shape ...

Any ideas?

Thanks,
Mike.



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
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 01:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Sheet protection Smitty Excel Discussion (Misc queries) 7 January 11th 09 12:26 AM
sheet protection jaci Excel Discussion (Misc queries) 1 August 31st 05 08:46 PM
Sheet protection OK[_2_] Excel Programming 1 October 3rd 03 03:01 PM


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