Run time error- Please Help
Manage your personal finances in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Run time error- Please Help

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have a problem. I have a workbook that is a overtime equalization project that I have been working on. It has departments in several worksheets that have macros that sort the employees by the lowest overtime hours.
    In order to make the macro work, I had to include in the macro a command to unprotect the active worksheet otherwise, I got an error because there is some pasting that goes on in the macor also. Before the macro is finished, I have a protect active sheet command so the data is protect. Things like names, social sec. number, date of hire. I have a specific group of cells that remain unprotected because they are unlocked for data entry.
    So anyway, my problem occured when I set the workbook up to be shared.
    Now I am getting a Run time error '1004'. It states: unprotect method of worksheet class failed.
    The first command in the macro is AcitveSheet.Unprotect.
    Is this the problem?

    Please help.

    Thanks,

    Jerry



  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Massachusetts, USA
    Posts
    255
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    The first command should probably be

    Sheets("Sheet1").Select

    Then the macro knows which sheet to start with.

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    OK Run-Time Error 1004 is a wooooooper of a floor in the programming of Excel and is very common be that good its a bug/error thats covering a million issues, can i ask exactly what you do prior to the error and at what stage the error appears..

    IF you script running can i request you do not debug, try step troough the line will trip as you run just that line, debug will do simular but i want to see if the running is hanging or if will run smooth if line by line....

    Please give as much data / details as poss, or if poss post the script..


    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hi

    More bits what windows version are you running and you not possibly running Excel 2000 are you?


    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com