+ Reply to Thread
Results 1 to 7 of 7

Run-time error '1004' when sheet is locked

  1. #1
    Registered User
    Join Date
    08-22-2010
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Run-time error '1004' when sheet is locked

    Hello!

    I have a problem when I try to run macros on locked sheet. When the sheet is unlocked, macros work perfectly, but when I locked them, I get message: Run-time error '1004' (and rest is in croatian, so I don't know how would it be in english)..

    I'm not native english speaker, so I think you will understand my problem best if you try to do it on example.

    So, you have to open Woorkbook and select sheet 'Ocjene financijskih pokazatelja'. The sheet is unprotected so the macros related to that sheet (which are assigned to objects uperleft) are working just as I want. I recomend to try them to understand what they do. They just hide and unhide some columns and set value in one cell. The first is called odn_dan_kred_prim_dep.

    After that, you shold protect that sheet and try macros again. They won't work..

    I'm not an excel expert so the macros are quite simple, I think. I' m working on this as a part of my final work to get faculty degree, and it's very important to me to solve this..

    So, I would be very grateful if someone could solve my problem!

    P.S. I deleted unnecessary sheets and macros to reduce the file size.

    Best regards,

    Dejan
    Attached Files Attached Files

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run-time error '1004' when sheet is locked

    Just unprotect the sheet at the start of the code then reprotect at the end.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    08-22-2010
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Run-time error '1004' when sheet is locked

    OK, but I don't know how to do that.. :|

    Could you write me a sample code just to see the sintax, please? Since I'm not very familiar with macros..

    And what about password? Will that method ask user to write password every time he run macro?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run-time error '1004' when sheet is locked

    Sample code, with password:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-22-2010
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Run-time error '1004' when sheet is locked

    Yeah, it works!

    Thank you very much!

    Best regards,
    Dejan

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run-time error '1004' when sheet is locked

    Glad to help. Please don't forget to mark the thread 'Solved'

  7. #7
    Registered User
    Join Date
    05-21-2013
    Location
    Adelaide
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Run-time error '1004' when sheet is locked

    This worked well. thanks

+ 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