+ Reply to Thread
Results 1 to 6 of 6

worksheet lock / unlock problem

  1. #1
    Registered User
    Join Date
    07-22-2010
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Exclamation worksheet lock / unlock problem

    Hi all,

    I have some code that unlocks EXCEL 2003 worksheets when a user tries to save, and places a new xslx file in a specified location, then relocks the original sheet.

    This all works fine, but i get an 'Excel has encountered a problem and needs to close...' just after the save completes, causing the recovery wizard to start up which is slightly annoying

    Would anyone be able to tell me if they can replicate this, or spot anything within my code that's causing the error?

    Cheers!

    Please Login or Register  to view this content.
    Last edited by xes; 07-22-2010 at 10:05 AM.

  2. #2
    Registered User
    Join Date
    07-22-2010
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: worksheet lock / unlock problem

    May also help if i state the workbook contains 10 worksheets. Not sure if it's this that it doesn't like!?

  3. #3
    Registered User
    Join Date
    07-22-2010
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: worksheet lock / unlock problem

    Did anyone get a chance to take a look?

    Cheers guys!

  4. #4
    Registered User
    Join Date
    07-22-2010
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: worksheet lock / unlock problem

    I've tested this on other pc's and the error always occurs on save - is there any way to prevent the recovery wizard from appearing, or stop the 'excel has encountered a problem and needs to close' message from popping up?

    Thanks

  5. #5
    Registered User
    Join Date
    07-22-2010
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: worksheet lock / unlock problem

    If i run this code on a file containing only 2 worksheets it runs without error, if i add a 3rd it errors...

    Anyone able to help at all?

  6. #6
    Registered User
    Join Date
    07-22-2010
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: worksheet lock / unlock problem

    Ahhh! An advantage of having no replies i guess is solving the problem by yourself!

    For anyone remotely interested, I added the Cancel = True to the top of my Workbook_BeforeSave() Sub.

    Fixed code:
    Please Login or Register  to view this content.

+ 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