+ Reply to Thread
Results 1 to 10 of 10

Run-Time Error 13 type mismatch

  1. #1
    Registered User
    Join Date
    11-16-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Run-Time Error 13 type mismatch

    My code here works on 2 of my laptops but when I run it on my 3rd machine. I get a runtime error 13 - type mismatch. The debugger highlights the "Next olApt" line. Thoughts?


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Run-Time Error 13 type mismatch

    Try change Sheets("Outlook").Range("O2").Text to Sheets("Outlook").Range("O2").Value see if that works.

  3. #3
    Registered User
    Join Date
    11-16-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Run-Time Error 13 type mismatch

    Quote Originally Posted by JieJenn View Post
    Try change Sheets("Outlook").Range("O2").Text to Sheets("Outlook").Range("O2").Value see if that works.
    That was the first thing i tried, but changing it to value still gets me the same error????

  4. #4
    Registered User
    Join Date
    11-16-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Run-Time Error 13 type mismatch

    Quote Originally Posted by JieJenn View Post
    Try change Sheets("Outlook").Range("O2").Text to Sheets("Outlook").Range("O2").Value see if that works.
    That was the first thing i tried, but changing it to value still gets me the same error????

  5. #5
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Run-Time Error 13 type mismatch

    hum... post your workbook?

  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: Run-Time Error 13 type mismatch

    I think the problem is because you are deleting olApt.

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    11-16-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Run-Time Error 13 type mismatch

    Quote Originally Posted by Norie View Post
    I think the problem is because you are deleting olApt.

    Try this.
    Please Login or Register  to view this content.
    tried this and the good news is the appointment was removed from my calendar. previously the code did not delete any appointments but i still get the same runtime error. this time the debugger highlights the row "Set OlApt = OlFldr.Items(i)

  8. #8
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Run-Time Error 13 type mismatch

    how about add on error statement see if that works. Unfortunately I don't want to touch outlook VBA when I am at work. But give it a try.

    Please Login or Register  to view this content.

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

    Re: Run-Time Error 13 type mismatch

    What happens if you declare olApt as Object?

  10. #10
    Registered User
    Join Date
    11-16-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Run-Time Error 13 type mismatch

    Norie, That did the trick. i declared olApt as an object and it worked. It works for both with my original code for each and the for I you previously recommended.

    JieJenn, i also included an error handler. (better safe than sorry)

    here is what the final code looks like

    Please Login or Register  to view this content.

+ 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