+ Reply to Thread
Results 1 to 5 of 5

Excel 2003 protect not working in Excel 97

Hybrid View

  1. #1
    Registered User
    Join Date
    09-11-2005
    Posts
    5

    Question Excel 2003 protect not working in Excel 97

    Hi I have created a program that unprotects the reprotects as users press buttons etc which works fine in Office 2000 and office 2003, but the users of the program are still running Office 97, with which the code returns an error.


    This is my general syntax:


    Sub ProtectAll()
    Sheets("sheet1").Protect
    Sheets("sheet2").Protect
    Sheets("sheet3").Protect
    End Sub


    Sub UnProtectAll()
    Sheets("sheet1").Unprotect
    Sheets("sheet2").Unprotect
    Sheets("sheet3").Unprotect
    End Sub


    Any advice would be greatly appreciated.
    As far as I can see the help from 97 vs 2003 is the same

  2. #2
    Gary Keramidas
    Guest

    Re: Excel 2003 protect not working in Excel 97

    those work in excel97 for me, are there any passwords?

    --


    Gary


    "norman1nz" <norman1nz.1x0mec_1129500317.3233@excelforum-nospam.com> wrote
    in message news:norman1nz.1x0mec_1129500317.3233@excelforum-nospam.com...
    >
    > Hi I have created a program that unprotects the reprotects as users
    > press buttons etc which works fine in Office 2000 and office 2003, but
    > the users of the program are still running Office 97, with which the
    > code returns an error.
    >
    >
    > This is my general syntax:
    >
    >
    > Sub ProtectAll()
    > Sheets("sheet1").Protect
    > Sheets("sheet2").Protect
    > Sheets("sheet3").Protect
    > End Sub
    >
    >
    > Sub UnProtectAll()
    > Sheets("sheet1").Unprotect
    > Sheets("sheet2").Unprotect
    > Sheets("sheet3").Unprotect
    > End Sub
    >
    > Any advice would be greatly appreciated.
    > As far as I can see the help from 97 vs 2003 is the same
    >
    >
    > --
    > norman1nz
    > ------------------------------------------------------------------------
    > norman1nz's Profile:
    > http://www.excelforum.com/member.php...o&userid=27155
    > View this thread: http://www.excelforum.com/showthread...hreadid=476660
    >




  3. #3
    Tom Ogilvy
    Guest

    Re: Excel 2003 protect not working in Excel 97

    If you are calling this from a commandbutton, then change the
    TakeFocusOnClick property to false

    If it is another type of control from the control toolbox toolbar, then as
    the first line of code in the event, place

    ActiveCell.Activate

    --
    Regards,
    Tom Ogilvy


    "norman1nz" <norman1nz.1x0mec_1129500317.3233@excelforum-nospam.com> wrote
    in message news:norman1nz.1x0mec_1129500317.3233@excelforum-nospam.com...
    >
    > Hi I have created a program that unprotects the reprotects as users
    > press buttons etc which works fine in Office 2000 and office 2003, but
    > the users of the program are still running Office 97, with which the
    > code returns an error.
    >
    >
    > This is my general syntax:
    >
    >
    > Sub ProtectAll()
    > Sheets("sheet1").Protect
    > Sheets("sheet2").Protect
    > Sheets("sheet3").Protect
    > End Sub
    >
    >
    > Sub UnProtectAll()
    > Sheets("sheet1").Unprotect
    > Sheets("sheet2").Unprotect
    > Sheets("sheet3").Unprotect
    > End Sub
    >
    > Any advice would be greatly appreciated.
    > As far as I can see the help from 97 vs 2003 is the same
    >
    >
    > --
    > norman1nz
    > ------------------------------------------------------------------------
    > norman1nz's Profile:

    http://www.excelforum.com/member.php...o&userid=27155
    > View this thread: http://www.excelforum.com/showthread...hreadid=476660
    >




  4. #4
    Registered User
    Join Date
    09-11-2005
    Posts
    5
    Quote Originally Posted by Tom Ogilvy
    If you are calling this from a commandbutton, then change the
    TakeFocusOnClick property to false

    If it is another type of control from the control toolbox toolbar, then as
    the first line of code in the event, place

    ActiveCell.Activate

    --
    Regards,
    Tom Ogilvy
    Thanks for the tip
    Does that only need to be done for Excel 97? Strange. Because it works fine without activating a cell before protecting in 2000/2003. I will try this tonight

  5. #5
    Tom Ogilvy
    Guest

    Re: Excel 2003 protect not working in Excel 97

    It only has to be done in xl97, but it doesn't cause a problem in other
    versions - so you don't need a separate code base for xl97.

    --
    Regards,
    Tom Ogilvy

    "norman1nz" <norman1nz.1x0uqa_1129511116.2414@excelforum-nospam.com> wrote
    in message news:norman1nz.1x0uqa_1129511116.2414@excelforum-nospam.com...
    >
    > Tom Ogilvy Wrote:
    > > If you are calling this from a commandbutton, then change the
    > > TakeFocusOnClick property to false
    > >
    > > If it is another type of control from the control toolbox toolbar, then
    > > as
    > > the first line of code in the event, place
    > >
    > > ActiveCell.Activate
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >

    >
    > Thanks for the tip
    > Does that only need to be done for Excel 97? Strange. Because it works
    > fine without activating a cell before protecting in 2000/2003. I will
    > try this tonight
    >
    >
    > --
    > norman1nz
    > ------------------------------------------------------------------------
    > norman1nz's Profile:

    http://www.excelforum.com/member.php...o&userid=27155
    > View this thread: http://www.excelforum.com/showthread...hreadid=476660
    >




+ 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