+ Reply to Thread
Results 1 to 6 of 6

Error code #1004

  1. #1
    Registered User
    Join Date
    01-31-2010
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2003
    Posts
    6

    Error code #1004

    I am trying to create a command button and add code that references a different open workbook. I keep getting a 1004 error code on selecting cells. This only happens when I try to attach it to the command button that reference another workbook.. I can uses the code to reference the work book the macro was created in with no problem. Example below.

    Please Login or Register  to view this content.
    Any help would be appreciated!
    Thanks in advance.
    Last edited by kendenning; 01-31-2010 at 02:23 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Error code #1004

    Unqualified, the range reference is to the sheet in which the code resides. So,
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-31-2010
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Error code #1004

    Shg,

    Thanks for the help! This works fine but after I ran this macro, I ran into a problem with the macros on the target spreadsheet as follows.

    Run:Time error "1004"
    Unable to set the hidden property of range class.

    Please Login or Register  to view this content.
    It works on the target sheet as long as I don't run the other code. If I do, I get this error.
    Any suggestions?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Error code #1004

    Is the sheet protected?

  5. #5
    Registered User
    Join Date
    01-31-2010
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Error code #1004

    Yes it is. Do I need to write code to unprotect it in each macro? I have 4 sets of target button code that the user can toggle. Or, just the macro code from one sheet referencing the other?

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Error code #1004

    Do I need to write code to unprotect it in each macro?
    In each macro that's going to do something you otherwise can't do on a protected sheet, yes.

+ 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