Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect workbook
Hi,
I would like to protect the structure of a workbook. I have tried ActiveWorkbook.Protect Password:=pword, Structu=False ActiveWorkbook.Protect (pword, True) (where pword is a variable defined earlier) and various other combinations. I get a compile error in all cases - "Expected: =" What am I doing wrong? Eugene |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect workbook
Problem solved.
My password variable was a number which was not being accepted by Activeworkbook.Protect. Changed it to a string using Cstr(pword) and it works. Strange thing is that I used the same logic and commands to protect the sheets in the workbook. ActiveSheet.Protect Password:=pword works when the pword is an integer or other number. Quite quirky if you ask me. Eugene "eugene" wrote: Hi, I would like to protect the structure of a workbook. I have tried ActiveWorkbook.Protect Password:=pword, Structu=False ActiveWorkbook.Protect (pword, True) (where pword is a variable defined earlier) and various other combinations. I get a compile error in all cases - "Expected: =" What am I doing wrong? Eugene |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can protect worksheet then workbook but not Protect and Share in code | Excel Programming | |||
Protect Workbook Vs Protect Sheet | New Users to Excel | |||
Disable Tools, Protect, Protect Workbook | Excel Programming | |||
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? | Excel Programming | |||
Protect Workbook | Excel Programming |