Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Turning off/on protection in a macro

How do you turn off and on the protection of a workbook in a macro?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Turning off/on protection in a macro

Worksheets("Sheet1").Unprotect
or
Worksheets("Sheet1").Unprotect password:="whatever"

If you include the UserInterfaceOnly flag when you Protect the sheet, your
VBA code can do whatever it wants on a protected sheet. E.g.,

Worksheets("Sheet1").Protect UserInterfaceOnly:=True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Lucas" wrote in message
...
How do you turn off and on the protection of a workbook in a macro?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Turning off/on protection in a macro

Activeworkbook.Protect

Activeworkbook.Unprotect

HTH Otto

"Lucas" wrote in message
...
How do you turn off and on the protection of a workbook in a macro?



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- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Turning Off Protection Notification Chaplain Doug Excel Discussion (Misc queries) 2 August 22nd 06 03:18 PM
Turning a Macro into an add-in for Excel? John Excel Worksheet Functions 1 December 8th 04 09:53 PM
Turning a Macro into an add-in for Excel? John[_97_] Excel Programming 1 December 8th 04 09:53 PM
Turning off macro disabled pop-up pcw[_2_] Excel Programming 1 October 30th 03 08:32 PM


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