Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
WLMPilot
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
WLMPilot
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro or OLE method to insert worksheet from template workbook Lyndon Rickards Excel Discussion (Misc queries) 0 January 30th 06 08:46 PM
sort worksheet without affecting workbook Barry Excel Worksheet Functions 3 November 2nd 05 10:06 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
How to open a workbook with a specific worksheet displayed by defa ThaiNB New Users to Excel 2 January 21st 05 06:11 AM
Copying worksheet from workbook to another Mark Jackson Excel Worksheet Functions 0 January 14th 05 09:05 PM


All times are GMT +1. The time now is 01:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"