#1   Report Post  
ynissel
 
Posts: n/a
Default macro for protection

I recorded a macro to protect a sheet and then then workbook - and I input a
password. The recorded macro protects both the sheet and workbook - but
doesnt use a password. Is there a syntax to use to protect them with a
password ?
This is my code for recording the macro.

Application.CutCopyMode = False
ActiveWorkbook.Protect Structu=True, Windows:=False

Thanks,
Yosef
  #2   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

Yosef

lookup Protect in the VBA Help

ActiveSheet.Protect Password:=drowssap

ActiveWorkbook.Protect Password:=drowssap

ThisWorkbook.Protect Password:=drowssap

Regards

Trevor


"ynissel" wrote in message
...
I recorded a macro to protect a sheet and then then workbook - and I input
a
password. The recorded macro protects both the sheet and workbook - but
doesnt use a password. Is there a syntax to use to protect them with a
password ?
This is my code for recording the macro.

Application.CutCopyMode = False
ActiveWorkbook.Protect Structu=True, Windows:=False

Thanks,
Yosef



  #3   Report Post  
ynissel
 
Posts: n/a
Default

Im not a programmer so the help was a bit too confusing for me.
Ill copy in your syntax and see what happens. I assume drowssap is your
actual password ?
Thanks
"Trevor Shuttleworth" wrote:

Yosef

lookup Protect in the VBA Help

ActiveSheet.Protect Password:=drowssap

ActiveWorkbook.Protect Password:=drowssap

ThisWorkbook.Protect Password:=drowssap

Regards

Trevor


"ynissel" wrote in message
...
I recorded a macro to protect a sheet and then then workbook - and I input
a
password. The recorded macro protects both the sheet and workbook - but
doesnt use a password. Is there a syntax to use to protect them with a
password ?
This is my code for recording the macro.

Application.CutCopyMode = False
ActiveWorkbook.Protect Structu=True, Windows:=False

Thanks,
Yosef




  #4   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

Needs to be in quotes if it is the actual password ... my omission. Unless
you have a variable called drowssap with your password in it.

Yes, I'm sure the help on this used to be more simple than it is now.

Regards

Trevor


"ynissel" wrote in message
...
Im not a programmer so the help was a bit too confusing for me.
Ill copy in your syntax and see what happens. I assume drowssap is your
actual password ?
Thanks
"Trevor Shuttleworth" wrote:

Yosef

lookup Protect in the VBA Help

ActiveSheet.Protect Password:=drowssap

ActiveWorkbook.Protect Password:=drowssap

ThisWorkbook.Protect Password:=drowssap

Regards

Trevor


"ynissel" wrote in message
...
I recorded a macro to protect a sheet and then then workbook - and I
input
a
password. The recorded macro protects both the sheet and workbook -
but
doesnt use a password. Is there a syntax to use to protect them with a
password ?
This is my code for recording the macro.

Application.CutCopyMode = False
ActiveWorkbook.Protect Structu=True, Windows:=False

Thanks,
Yosef






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
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 09:05 AM.

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"