+ Reply to Thread
Results 1 to 8 of 8

Code fails with error 1004

  1. #1
    Registered User
    Join Date
    09-22-2010
    Location
    Sugar Hill
    MS-Off Ver
    Excel 2003
    Posts
    6

    Code fails with error 1004

    Please Login or Register  to view this content.
    Last edited by cdjones; 09-22-2010 at 06:25 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Code fails with error 1004

    What's the code supposed to do?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-22-2010
    Location
    Sugar Hill
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Code fails with error 1004

    Code is supposed to open a workbook, and then select some cells for copying.

    The workbook opens, but I get error 1004 when I try the selection.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Code fails with error 1004

    Try:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  5. #5
    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: Code fails with error 1004

    Romper, aside from making the implicit explicit, I'm missing why that would fix whatever's wrong.

    The code would certainly fail if the active sheet were not a worksheet, but I can see little else. What am I missing?
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Code fails with error 1004

    If that code is in a worksheet code module, then the two Cells calls would refer to that sheet, not to the active sheet, and cause an RTE.

  7. #7
    Registered User
    Join Date
    09-22-2010
    Location
    Sugar Hill
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Code fails with error 1004

    Working, thanks

  8. #8
    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: Code fails with error 1004

    If that code is in a worksheet code module
    Doh !

+ 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