+ Reply to Thread
Results 1 to 4 of 4

Vlookup application or object defined error... cannot figure out what's wrong

  1. #1
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Vlookup application or object defined error... cannot figure out what's wrong

    I have the following code:

    Please Login or Register  to view this content.
    The code for defining StepFour is fine, so there seems to be something wrong with my syntax. I've used the macro recorder to try to reproduce exactly what this is supposed to look like, and it looks exactly the same. I can't figure out why I'm getting an error.

    The book I'm running this on (where column K is) is an .xls sheet, while the file I'm looking to is an .xlsx, but I've tried saving both as .xlsx or both as .xls and it doesn't make a difference.

    Can anyone explain to me why I am getting this error: "Run-time error '1004': Application-defined or object-defined error."

    I've also tried this as:

    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    As far as the code goes, what I have here column-wise is exactly what the recorder came up with. I'm looking from column K back to column A, (RC-10] to the workbook that I've named StepFour, on a sheet called Data, in columns 12-20.

    I am so fed up with vlookup!
    Last edited by lordterrin; 08-01-2014 at 04:25 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Vlookup application or object defined error... cannot figure out what's wrong

    Try this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Vlookup application or object defined error... cannot figure out what's wrong

    I have a much more complicated section of the sheet:

    Please Login or Register  to view this content.
    that works just fine, using the exact same methodology of code.

    Prior to my sub, I have:

    Please Login or Register  to view this content.
    and I've run vlookups against these using what I swear to be the exact same code. I can't define StepFour as a string, because it's a workbook, not a string. I can't do things like "StepFour.Activate" or "StepFour.Save" if it's a string.....

    There is something that I've done and I can't figure it out, but I need to keep the general idea of this the same.

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Vlookup application or object defined error... cannot figure out what's wrong

    or

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. excel macro run time error '1004'- Application defined or object defined error
    By kmadan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2014, 09:51 AM
  2. Replies: 1
    Last Post: 03-12-2014, 12:42 PM
  3. Replies: 2
    Last Post: 09-12-2012, 01:01 PM
  4. Replies: 0
    Last Post: 05-14-2012, 11:59 PM
  5. Application Defined or Object Defined Error, Command Button and Vlookup Function
    By stevedomer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-14-2011, 11:20 PM

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