+ Reply to Thread
Results 1 to 5 of 5

Cannot create text string

  1. #1
    Registered User
    Join Date
    11-20-2009
    Location
    Lisbon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Cannot create text string

    Hi,

    I am trying to create the following text string that matches this formula:
    Please Login or Register  to view this content.
    The text string that i want, to be equals to the formula is the following:
    Please Login or Register  to view this content.
    When i run my problem i have an error in this text string, and the error is "application-defined or object-defined error".

    Best Regards,
    JP.

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

    Re: Cannot create text string

    VBA in heavily Americanised - ie when writing formulae from VBA to cells always use US based syntax regardless of your own locale.

    In this particular instance you should use a comma delimiter as opposed to the semi colon (as you use in native XL given your locale)

    ie

    =SUMIF(A22:A60;"<>zEz";R22:R60)

    would be entered from VBA as

    =SUMIF(A22:A60,"<>zEz",R22:R60)

    regardless of client locale.... so in short change ; to , and you should be ok.

    Note: once "written" to native XL the delimiters will be translated automatically - ie the commas will have become semi-colons.
    Last edited by DonkeyOte; 11-23-2009 at 02:03 PM.

  3. #3
    Registered User
    Join Date
    11-20-2009
    Location
    Lisbon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Cannot create text string

    Hi,

    I have tried that solution but didnt worked.
    I think the problem is with the zEz string, in that criteria i want to compare the text string "zEz". (note that zEz is not an alias of a range/cells)

    Best Regards,
    JP.

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

    Re: Cannot create text string

    JP, I did not notice previously but you have a space in your string after the last reference to column R (prior to insertion of LastRow variable) and this is not valid syntax - if you correct for that your formula should work without issue (semi colon point holds).

    EDIT: I should add that if you use .FormulaLocal property as opposed to standard .Formula you can enter with locale specific delimiters
    Last edited by DonkeyOte; 11-24-2009 at 07:47 AM.

  5. #5
    Registered User
    Join Date
    11-20-2009
    Location
    Lisbon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Cannot create text string

    Thank you it worked fine, i hate this type type of errors, next time i ill be more atention
    I am using Formula.

    Best Regards,
    JP.

+ 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