+ Reply to Thread
Results 1 to 7 of 7

Excel to Outlook Error 13 Data Mismatch when Creating Tasks

  1. #1
    Registered User
    Join Date
    02-23-2015
    Location
    Addis Ababa, Ethiopia
    MS-Off Ver
    2013
    Posts
    4

    Excel to Outlook Error 13 Data Mismatch when Creating Tasks

    Hi all, I've been on the forums for a long time trying to figure out this problem but I just can't crack it so I'm looking for some help. I made a module which creates tasks in Outlook based on information in an excel file. When I run this Module it works BUT it still throws error 13 Data Mismatch for the due date on the task. It is particularly strange that it correctly puts the due date on the tasks but still throws the error.

    Please Login or Register  to view this content.
    When I run the module I get the tasks in Outlook but the line that says [ .DueDate = DateValue(strDate) ] is highlighted and a popup appears and says "Run-time error '13': Type Mismatch". I've been thinking that the issue might be stemming from some sort of data formatting conflict between what it is in excel versus what it needs to be for outlook. I have the dates set in the Date format in Excel that doesn't take into account the computer regional settings, which I think would be best.

    I have seen other posts where people post very similar code that worked for them which just leaves me more confused. Any help would be greatly appreciated.

    Thank you,
    Kire

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

    Re: Excel to Outlook Error 13 Data Mismatch when Creating Tasks

    If you have dates in Excel why are you using a string for the date and the converting it back to a 'real' date with DateValue?

    Have you tried storing the date in a variable with the Date data type?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-23-2015
    Location
    Addis Ababa, Ethiopia
    MS-Off Ver
    2013
    Posts
    4

    Re: Excel to Outlook Error 13 Data Mismatch when Creating Tasks

    Thank you for the quick reply. I had tried doing as you suggested a few times earlier today and it always failed, but now I see that I forgot to change all the "str" prefixes to "dt" so I changed them. However now it gives me error 13 mismatch error for the line:
    Please Login or Register  to view this content.
    So overall this is what it looks like

    Please Login or Register  to view this content.

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

    Re: Excel to Outlook Error 13 Data Mismatch when Creating Tasks

    I thought that might happen and I think it might mean that there's a problem with the data rather than the code.

    When you get the error check exactly what the value in ws.Range("E" & i) is.

  5. #5
    Registered User
    Join Date
    02-23-2015
    Location
    Addis Ababa, Ethiopia
    MS-Off Ver
    2013
    Posts
    4

    Re: Excel to Outlook Error 13 Data Mismatch when Creating Tasks

    The cells being references grab values from other cells in the same worksheet and those cells grab data from other cells across a lot of other worksheets. What kind of issue should I be looking for? Does every cell that could possibly be used need to all be a certain format?

    The ones being directly referenced (Column E) were in the date format of 3/14/12

    Thanks,
    Kire

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

    Re: Excel to Outlook Error 13 Data Mismatch when Creating Tasks

    Is that the value when you get the error?

    That's the value you should be looking it.

  7. #7
    Registered User
    Join Date
    02-23-2015
    Location
    Addis Ababa, Ethiopia
    MS-Off Ver
    2013
    Posts
    4

    Re: Excel to Outlook Error 13 Data Mismatch when Creating Tasks

    The date that shows up in the Outlook task is correct from Column E.
    It is just so weird that the dates transfer correctly but the error still shows up...

+ 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. Outlook Calendar Populater... Help with mismatch error
    By joel.underwood in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2014, 02:07 PM
  2. Replies: 0
    Last Post: 05-09-2013, 12:32 PM
  3. Creating outlook tasks
    By nugget86 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2013, 08:40 AM
  4. Tasks to Outlook based on data in excel
    By solocharls in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-05-2012, 09:03 AM
  5. Outlook Tasks - Adding tasks from a worksheet added today or after
    By dpotta in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2010, 07:15 AM

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