Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How could I run my macros in a protected with password worksheet
Hi everyone!,
I am building an small application where I want the data in a workshee be protected with a password and still be capable to run macros (Exce 2000). I been reading the messages in this forum and i get the idea t include the protect / Unprotect instruction in the macro (ActiveWorkbook.Unprotect Password:="abcd"). I already did that but i doesn“t work (error 1004). Could you give me a hand? Thank you all. Jos -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How could I run my macros in a protected with password worksheet
The macros will still work generally when a workbook nis
protected. It is only when your try and run a command in VBA which is not available to run when the workbook is protected that the macro will fail. An example of this is conditional formatting. If you protect a workbook and try and add conditional formatting through the menu it will ot let you. An so with VBA the commands for those same things will not run in VBA either. If a command runs normally off the menu when the workbook is protected then it should run in VBA. If you really do need to protect and unprotect on the run then try these: Private Sub unprotect_cells() ActiveWorkbook.UnprotectSharing ("xxx") ActiveSheet.Unprotect ("xxx") End Sub Private Sub protect_sheet() Dim wrkbk As String ActiveSheet.Protect ("xxxx") wrkbk = ThisWorkbook.Name End Sub BOL David C -----Original Message----- Hi everyone!, I am building an small application where I want the data in a worksheet be protected with a password and still be capable to run macros (Excel 2000). I been reading the messages in this forum and i get the idea to include the protect / Unprotect instruction in the macro (ActiveWorkbook.Unprotect Password:="abcd"). I already did that but it doesn“t work (error 1004). Could you give me a hand? Thank you all. Jose --- Message posted from http://www.ExcelForum.com/ . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How could I run my macros in a protected with password worksheet
Thank you David for your prompt response. I “ll try your solution and
Let you know. See you around Josč Luis --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Macros in a Password-protected workbook? | Excel Discussion (Misc queries) | |||
How to retrive password protected worksheet but forgot password? | Excel Worksheet Functions | |||
Macros will not run in a password protected file office 2007 pro | Excel Discussion (Misc queries) | |||
Password protected worksheet | Excel Discussion (Misc queries) | |||
Delete Password protected macros | Excel Programming |