+ Reply to Thread
Results 1 to 6 of 6

Excel VBA Error Code 424 Object Required

  1. #1
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Excel VBA Error Code 424 Object Required

    Hi

    I keep getting an error message on the macro I have built but I am not sure why. I keep getting the error "Object Required".

    I have built a macro whcih uses the list in the current workbook to open two documents and then loop through the list and find the cell content in A:A of the first document opened and paste it into the second document open. The macro opens the two documents however when it comes to activating the first workbook (which contains the macro and list) it brings up this error.

    Please Login or Register  to view this content.
    I have highted the line it debugs on and produces the error.

    Can anyone explain why it produces this error?

    Thanks,

    Jeskit
    Last edited by jeskit; 12-14-2011 at 08:24 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: Excel VBA Error Code 424 Object Required

    Remove the Activate part. I would also use:
    Please Login or Register  to view this content.
    rather than Windows.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Excel VBA Error Code 424 Object Required

    Hi

    Thanks works great now.

    But could i ask why it worked with Workbooks not Windows? don't they do the same thing??

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

    Re: Excel VBA Error Code 424 Object Required

    No - Windows returns a Window object and Workbooks returns a Workbook object. They are not the same thing. Also, Activate doesn't return anything.

  5. #5
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Excel VBA Error Code 424 Object Required

    Oh, ok I alway through windows and Workbook opened a workbook window. But ok my mistake.

    Thanks for the help, its greatly appricated!!

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

    Re: Excel VBA Error Code 424 Object Required

    A workbook can have more than one window open on it (so you can view multiple sheets at the same time).

+ 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