+ Reply to Thread
Results 1 to 3 of 3

Protecting a worksheet / workbook with macros

  1. #1
    WLMPilot
    Guest

    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. #2
    Kevin B
    Guest

    RE: 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. #3
    WLMPilot
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1