ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Password - Protect, UnProtect (https://www.excelbanter.com/excel-programming/272767-password-protect-unprotect.html)

MrAlMackay

Password - Protect, UnProtect
 
Could anyone help me with the below:

Would like to have a macro that does the following:

1) Goes to the Unprotect Sheet dialog box where the user will need to enter in
the password.

2) Also would like this macro to load up automatically when I open my
spreadsheet. I know I can use Auto_Open however I want to call this macro
within the Auto_Open macro.

Appreciate your help on the above,

Many Thanks - Al Mackay
( )

Lakeuk[_2_]

Password - Protect, UnProtect
 
Problem with using macros and unprotect commands is that you can see the
password in your vba code, have password typed in as varable.

Dave



"MrAlMackay" wrote in message
...
Could anyone help me with the below:

Would like to have a macro that does the following:

1) Goes to the Unprotect Sheet dialog box where the user will need to

enter in
the password.

2) Also would like this macro to load up automatically when I open my
spreadsheet. I know I can use Auto_Open however I want to call this macro
within the Auto_Open macro.

Appreciate your help on the above,

Many Thanks - Al Mackay
( )




Chip Pearson

Password - Protect, UnProtect
 
Al,

If you attempt to unprotect a password-protected sheet without
supplying the password, Excel will automatically prompt for the
password.

ActiveSheet.Unprotect



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




"MrAlMackay" wrote in message
...
Dave

Don't actually want the spreadsheet to be unprotected through

the macro.

I only want to get to the dialog box (@ this point I would need

the macro to
end) as this is when the user would type in the password or

alternatively if it
isn't one of the administrators they would exit out.

Is it possible to get the dialog box through VBA?

Appreciate your help on this.

Many Thanks, Al




MrAlMackay

Password - Protect, UnProtect
 
Cheers for your help with this.

Worked a treat.

Thanks, Al.

Jeff[_44_]

Password - Protect, UnProtect
 
Have a similar issue but want to call the the Protect Sheet dialog box
via VBA to allow the user to enter a password if desired - can someone
advise how I might do this?

Thanks!

Jeff


Jeff[_44_]

Password - Protect, UnProtect
 
Thanks Ben - I'll give that a try but wanted to clarify - Did you mean
that this will only work in Excel 2003? If so, are there other
solutions for Excel 97, 2K & XP? Am wanting this code to work across
all versions from 97 onwards ...

Jeff



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com