+ Reply to Thread
Results 1 to 6 of 6

application or object defined error raised by some simple construct

  1. #1
    Registered User
    Join Date
    07-16-2010
    Location
    U.K.
    MS-Off Ver
    Excel 2003 and Excel 2007
    Posts
    36

    application or object defined error raised by some simple construct

    I'm writing some simple vba project that is copying some values from one worksheet to another and does some basic calculation.

    At one point I got an error "Run-time error '1004' Application defined or object-defined error" - this is the line that causes it:

    Please Login or Register  to view this content.

    CellAddressDeb has value of "C8" (type Variant/String)
    CellAddressEnd has value of "C12" (type Variant/String)

    I tried to find some information on this type of error but it wasn't much informative. What is the problem with this code and how to fix it?

    Thank you

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: application or object defined error raised by some simple construct

    Because your location is 'Earth' it isn't very informative on 'local' that you use in FormulaLocal:
    What happens using Formula instead of FormulaLocal ?
    And you shouldn't use ; (VBA has an American accent), but comma.
    Please Login or Register  to view this content.
    you could consider
    Please Login or Register  to view this content.
    Last edited by snb; 07-20-2010 at 09:26 AM.

  3. #3
    Registered User
    Join Date
    07-16-2010
    Location
    U.K.
    MS-Off Ver
    Excel 2003 and Excel 2007
    Posts
    36

    Re: application or object defined error raised by some simple construct

    thank you it worked very well

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: application or object defined error raised by some simple construct

    Quote Originally Posted by snb View Post
    What happens using Formula instead of FormulaLocal ?
    And you shouldn't use ; (VBA has an American accent), but comma.
    Unless of course you are using FormulaLocal and your locale dictates semi colon delimiter at which point your syntax should reflect local defaults.

    I suspect the actual issue with your original code is the misspelling of cellAdresseEnd variable in the formula itself.

    If you correct the spelling in your formula such that it matches the variable declaration you should find your code works without issue.
    (again assuming you use a semi colon delimiter and also that cellAdressFin is defined correctly - should this not be cellAdressEnd also ?)

  5. #5
    Registered User
    Join Date
    07-16-2010
    Location
    U.K.
    MS-Off Ver
    Excel 2003 and Excel 2007
    Posts
    36

    Re: application or object defined error raised by some simple construct

    it is all correct but first advice got it already (other e was corrected by myself) but thx

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: application or object defined error raised by some simple construct

    No problem.

    I was just clarifying that you don't need to use US-centric syntax for formulae if you're using FormulaLocal property
    (the prior solution had implied otherwise but was I suspect making similar point given your locale is unspecified).
    Last edited by DonkeyOte; 07-21-2010 at 02:38 AM. Reason: re-worded

+ 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