+ Reply to Thread
Results 1 to 5 of 5

Type mismatch: Cannot coerce parameter value. Outlook cannot translate your string

  1. #1
    Registered User
    Join Date
    10-27-2012
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    98

    Unhappy Type mismatch: Cannot coerce parameter value. Outlook cannot translate your string

    Hi All
    I am hoping someone can help.

    I have 2 macros that work when run separately:
    Build_Pivot_Row_Sheet ← Click the 'SLA Checks' button on the All Data sheet
    Send_Email

    [Build_Pivot_Row_Sheet] loops through all the 'SLA' sheets and shows the pivot table row details, then copies & pastes it into a sheet called 'Pivot Rows'
    [Send_Email] takes the info from the 'Pivot Rows' and sheet creates a summary in a temp file and attaches it to an email

    When I run them separately they work.
    But when I call [Send_Email] at the end of the [Build_Pivot_Row_Sheet] I get an error at the line where it would populate the email address field?

    Type Mismatch.png

    Any advice would be greatly appreciated
    Thanks
    Vicky
    Last edited by vwhite; 08-18-2020 at 09:18 AM.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Type mismatch: Cannot coerce parameter value. Outlook cannot translate your string

    Does it help if you put DoEvents before the .To = ... line?
    Rory

  3. #3
    Registered User
    Join Date
    10-27-2012
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Type mismatch: Cannot coerce parameter value. Outlook cannot translate your string

    Yes Rory it really does!
    Thank you so much

    8 little characters and the error has gone away

    What do you think the problem was (in laymans terms) and why does 'DoEvents' fix it?

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Type mismatch: Cannot coerce parameter value. Outlook cannot translate your string

    In layman's terms, it was "computer says no". I can't really say why, but the code worked fine when run separately, and also when stepped through, so it appeared to be a timing issue, and DoEvents allows the computer to catch up with itself, if you like.

  5. #5
    Registered User
    Join Date
    10-27-2012
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    98

    Red face Re: Type mismatch: Cannot coerce parameter value. Outlook cannot translate your string

    Good to know. Thanks again

+ 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. [SOLVED] Type mismatch for date extracted from string
    By caabdul in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2018, 09:51 AM
  2. type mismatch, for string/value
    By slemieux99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2017, 11:58 AM
  3. [SOLVED] Getting Type Mismatch with String passed to a Function with String parameter
    By allansy8 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2014, 10:33 PM
  4. Replies: 0
    Last Post: 05-29-2014, 09:38 AM
  5. cannot coerce parameter value. outlook
    By Illse in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2013, 01:57 AM
  6. ODBC SQL string - type mismatch
    By spike1988 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2013, 06:41 PM
  7. Testing value of string but its a number........gives type mismatch error
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-18-2011, 05:06 PM

Tags for this Thread

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