+ Reply to Thread
Results 1 to 3 of 3

Run-time Error: 1004 Application Defined or Object Defined Error

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    62

    Lightbulb Run-time Error: 1004 Application Defined or Object Defined Error

    Hey again,

    I'm running this Macro from my main Workbook: "New_Reconciliation." The macros last command has me Active in Workbook "Cadet" (both Workbooks are now open).

    The below is supposed to take the value from the Named Range "Last_601" which is located in "New_Reconciliation." and find that value in "Cadet."

    I'm getting the error: Run-time Error: 1004 Application Defined or Object Defined Error

    When I scroll over the code: MySearch = Range("Last_601").String I get the messages:

    MySearch=Empty

    Quick Watch gives me MySearch Value <Out of Context> and Range <Expression not Defined in Context>

    Please Login or Register  to view this content.
    Anyone got any great insights??

    PS I declared Dim Last_601 As String above in the coding in case anyone thought I had forgot.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Run-time Error: 1004 Application Defined or Object Defined Error

    .String isn't anything. What are you trying to do with that line? Put the values into an array?

    Also you indicate you have multiple open workbooks. You need to declare workbooks and worksheets for your ranges or else you are going to have issues.
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Run-time Error: 1004 Application Defined or Object Defined Error

    There is no String property, you should use Value.

    However that might not be the problem, have you checked the named range 'Last_601' is returning a valid reference?

    Have you tried adding a worksheet reference for that range?
    Please Login or Register  to view this content.
    PS No need to declare Last_601 but that shouldn't be a problem, though it might be worth removing the declaration just in case.

    PPS Where are you setting ws to refer to the sheet 'Cadet'?
    If posting code please use code tags, see here.

+ 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. VBA ERROR: run time error 1004: Application-defined or Object-defined error in excel 2013
    By AnanthKrishna in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2015, 06:16 AM
  2. [SOLVED] Keep receiving Run-time error '1004': Application-defined or object-defined error
    By BladeAP in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2014, 04:24 PM
  3. 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
  4. Replies: 1
    Last Post: 03-12-2014, 12:42 PM
  5. [SOLVED] Run time error 1004 Application-Defined or Object-Defined Error - Placing data into next e
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-27-2014, 12:57 PM
  6. [SOLVED] Error " Run-time error '1004': application defined or object defined error
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:26 AM
  7. [SOLVED] run-time error '1004' application-defined or object-defined error - Excel 2007
    By kaurka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2012, 02:46 AM

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