![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Massachusetts, USA
Posts: 255
|
I have an excel spreadsheet with 2 simple macros, which run in a specific order. Both macros unprotect the spreadsheet as the first step, and protect with the last step (password is included in code). After I run the first macro, if I go to unprotect the sheet, I am NOT prompted for a password. If I run the second macro, and then try to unprotect the sheet, I am prompted for a password. The macros both have the same language...???
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
The .Protect and .Unprotect methods have an optional parameter which is the password. Are you sure you're supplying it when you unprotect and when you re-protect ?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Massachusetts, USA
Posts: 255
|
Yes - both macros are identical with regards to the protect, unprotect. I am begining to think it is a glitch.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|