Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Protecting a worksheet / workbook with macros
I have setup spreadsheets (within one workbook) that lets you enter info in
the computer to assist in balancing your checkbook instead of having to manually write down the uncleared transactions and then calculate. The problem is this: I have macros in this workbook and I am trying to protect the worksheet / workbook. However, when I protect it, the macros do not work. As soon as I unprotect it, the macros work. Any suggestions? Thanks, Les |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Protecting a worksheet / workbook with macros
Unprotect the worksheet, run your code and then reprotect the worksheet:
With ActiveSheet .Protect DrawingObjects:=True, Contents:=True, _ Scenarios:=True, Password:="Password" .EnableSelection = xlUnlockedCells End With "Your current macro code here ActiveSheet.Unprotect Password:="Password" -- Kevin Backmann "WLMPilot" wrote: I have setup spreadsheets (within one workbook) that lets you enter info in the computer to assist in balancing your checkbook instead of having to manually write down the uncleared transactions and then calculate. The problem is this: I have macros in this workbook and I am trying to protect the worksheet / workbook. However, when I protect it, the macros do not work. As soon as I unprotect it, the macros work. Any suggestions? Thanks, Les |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Protecting a worksheet / workbook with macros
The macros are activated by clicking a command button. Since I have Jan -
Dec set up within the same spreadsheet, I created buttons w/ macros for each so that you can click on a certain month and that month appears on the screen. Therefore, it is not a one-time thing where the macro is executed. Being new to macros and VBA, I am not sure what the code is that you typed in your response to my initial question. Thanks, Les "Kevin B" wrote: Unprotect the worksheet, run your code and then reprotect the worksheet: With ActiveSheet .Protect DrawingObjects:=True, Contents:=True, _ Scenarios:=True, Password:="Password" .EnableSelection = xlUnlockedCells End With "Your current macro code here ActiveSheet.Unprotect Password:="Password" -- Kevin Backmann "WLMPilot" wrote: I have setup spreadsheets (within one workbook) that lets you enter info in the computer to assist in balancing your checkbook instead of having to manually write down the uncleared transactions and then calculate. The problem is this: I have macros in this workbook and I am trying to protect the worksheet / workbook. However, when I protect it, the macros do not work. As soon as I unprotect it, the macros work. Any suggestions? Thanks, Les |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro or OLE method to insert worksheet from template workbook | Excel Discussion (Misc queries) | |||
sort worksheet without affecting workbook | Excel Worksheet Functions | |||
Inserting Filtered RC cell information into other worksheets | Excel Discussion (Misc queries) | |||
How to open a workbook with a specific worksheet displayed by defa | New Users to Excel | |||
Copying worksheet from workbook to another | Excel Worksheet Functions |