Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Removing and Applying protection in VBA

Neil,

Change ActiveWorksheet to ActiveSheet

--
sb
"Neil Warwick" wrote in message
...
Is there a way that I can remove and add protection to the
worksheet in VBA on Excel 2000 / XP?
According to the online help I can use the commands:-
ActiveWorksheet.Protect and ActiveWorksheet.Unprotect

I have tried to use them in the format shown below, but
they don't seem to work correctly.

ActiveWorksheet.Unprotect "frodo"
ActiveWorksheet.Protect Password:="frodo"

I'm pretty new to all this VBA stuff so any help would be
appreciated (Can anyone recommend a good book?)

Thanks

Neil



  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Removing and Applying protection in VBA

Cheers Steve,

How much of a dope do I feel!

Neil


-----Original Message-----
Neil,

Change ActiveWorksheet to ActiveSheet

--
sb
"Neil Warwick"

wrote in message
...
Is there a way that I can remove and add protection to

the
worksheet in VBA on Excel 2000 / XP?
According to the online help I can use the commands:-
ActiveWorksheet.Protect and ActiveWorksheet.Unprotect

I have tried to use them in the format shown below, but
they don't seem to work correctly.

ActiveWorksheet.Unprotect "frodo"
ActiveWorksheet.Protect Password:="frodo"

I'm pretty new to all this VBA stuff so any help would

be
appreciated (Can anyone recommend a good book?)

Thanks

Neil



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Removing and Applying protection in VBA

Neil,

Not a dope! Just crazy Excel Syntax...

Suggest you force Option Explicit at the top of your modules and do a
compile before running your code. You'll catch these a lot faster...
(even though the messages you'll get won't be that enlightening.)

To force Option Explicit (on all NEW macros).
Go to the VBE
Tools Options Editor Require Variable Delcaration

--
sb
wrote in message
...
Cheers Steve,

How much of a dope do I feel!

Neil


-----Original Message-----
Neil,

Change ActiveWorksheet to ActiveSheet

--
sb
"Neil Warwick"

wrote in message
...
Is there a way that I can remove and add protection to

the
worksheet in VBA on Excel 2000 / XP?
According to the online help I can use the commands:-
ActiveWorksheet.Protect and ActiveWorksheet.Unprotect

I have tried to use them in the format shown below, but
they don't seem to work correctly.

ActiveWorksheet.Unprotect "frodo"
ActiveWorksheet.Protect Password:="frodo"

I'm pretty new to all this VBA stuff so any help would

be
appreciated (Can anyone recommend a good book?)

Thanks

Neil



.



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
removing password protection AllieR Excel Discussion (Misc queries) 1 March 17th 09 03:41 PM
Applying Protection To Multiple Sheets Mhz New Users to Excel 4 July 6th 06 01:22 PM
Removing Module Protection Programatically Adam Excel Discussion (Misc queries) 8 April 17th 06 05:46 AM
Removing protection from excel worksheets Rick Wilson Excel Worksheet Functions 3 March 27th 06 11:58 AM
Applying protection to an Excel Expense Report Donna Bennett Excel Programming 1 October 18th 03 03:33 PM


All times are GMT +1. The time now is 08:39 PM.

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"