Error 424 and 1004 On excel RRS feed

  • Question

  • Greetings

    I'm having a problem in a macro that always used to work perfectly.

    Nobody changed the code so i don't understand why this is happening.

    I tried to execute it on different machines and the errors are diferent...

    The code has no syntax error, it always worked...maybe it's some reference that i still need to choose to the project??

    I tried on office 2003 and 2007...

    2003 brings error 1004

    2007  error 424...

    If someone can try to help i would be very gratefull.

    Thanks in Advance



    Friday, September 16, 2011 3:38 PM


  • From the XL97 help file...

    Object required (Error 424)
    References to properties and methods often require an explicit object qualifier. This error has the following causes and solutions:

    ·   You referred to an object property or method, but didn't provide a valid object qualifier.
    Specify an object qualifier if you didn't provide one. For example, although you can omit an object qualifier when referencing a form
    property from within the form's own module, you must explicitly specify the qualifier when referencing the property from a
    standard module.

    ·    You supplied an object qualifier, but it isn't recognized as an object.
    Check the spelling of the object qualifier and make sure the object is visible in the part of the program in which you are referencing it.
    In the case of Collection objects, check any occurrences of the Add method to be sure the syntax and spelling of all the elements are correct.

    ·    You supplied a valid object qualifier, but some other portion of the call contained an error.
    An incorrect path as an argument to a host application's File Open command could cause the error. Check arguments.

    ·    You didn't use the Set statement in assigning an object reference.
    If you assign the return value of a CreateObject call to a Variant variable, an error doesn't necessarily occur if the Set statement is omitted. In the following code example, an implicit instance of Microsoft Excel is created, and its default property (the string "Microsoft Excel") is returned and assigned to the Variant RetVal. A subsequent attempt to use RetVal as an object reference causes this error:

     Dim RetVal                                ' Implicitly a Variant.
    'Default property is assigned to Type 8 Variant RetVal.
     RetVal = CreateObject("Excel.Application")   
     RetVal.Visible = True                ' Error occurs here.
     Use the Set statement when assigning an object reference.

    ·    In rare cases, this error occurs when you have a valid object but are attempting to perform an invalid action on the object.
    For example, you may receive this error if you try to assign a value to a read-only property.
    Check the object's documentation and make sure the action you are trying to perform is valid.
    Jim Cone
    Portland, Oregon USA

    Friday, September 16, 2011 9:44 PM