Outlook Macro Error 13
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow run time error 13 type mismatch excel the company Business Learn more about hiring developers or posting ads with us Stack Overflow runtime error 13 type mismatch fix Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 runtime error 13 type mismatch vb6 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up outlook VBA script run-time error 13 randomly while iterating emails in a public folder up vote 0 down vote
Run Time Error 13 Type Mismatch Access
favorite I am receiving a random run-time error 13 (type mismatch) executing the following subroutine. This routine works most of the time. The Folder passed in as an argument is legitimate at the time of the failure. From what I can see in the debugger, the objitem is missing some of the fields during runtime. After it break-points in the debugger, I can immediately single-step (re-executing the offending line) and there is run time error 13 type mismatch excel 2013 no error. I have attempted using 'on error goto' to sleep then retry various lines, and the error persists until it stops in the debugger. I have also attempted changing between the For ii and For Each forms of the loop commands. I have also temporarily disabled by anti-virus. I am iterating over a large number of public folders. My outlook client is 2003 running under XP, and I am attached to Exchange server version 7654. Can anyone tell me what I am failing to do (or if what I am attempting is not possible)? Code below is modified per @dmitry suggestions and now works. Sub SearchFolders(objFolder As Outlook.MAPIFolder) Dim objFolders As Outlook.Folders Dim subFolder As Outlook.MAPIFolder Dim Objitem As Outlook.MailItem Dim ii As Integer Dim ThisItem As Object Dim Items As Outlook.Items ' Recurse through all subfolders Set objFolders = objFolder.Folders For Each subFolder In objFolders Call SearchFolders(subFolder) Next subFolder ' Search the emails Set Items = objFolder.Items For ii = 1 To Items.Count Set ThisItem = Items.item(ii) If ThisItem.Class = olMail Then If VarType(ThisItem) = 9 Then GoTo NextdblLoop Set Objitem = ThisItem CheckEmailForErrorReports (objFolder.Items(ii)) Set Objitem = Nothing End If Set ThisItem = Nothing NextdblLoop: Next ii Set Items = Nothing End Sub outlook outlook-vba outlook-2003 share|improve this question edited Jan 23 '15
360 games PC games compile error type mismatch vba Windows games Windows phone games Entertainment All Entertainment
Runtime Error 13 Type Mismatch Excel 2007
Movies & TV Music Business & Education Business Students & educators
How To Fix Runtime Error 13 Type Mismatch In Vba
Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet http://stackoverflow.com/questions/28098914/outlook-vba-script-run-time-error-13-randomly-while-iterating-emails-in-a-public Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All https://support.microsoft.com/en-us/kb/181542 Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
Forums Excel Questions Excel VBA Run-time error '13' Type mismatch Page 1 of 2 12 Last Jump to page: Results 1 to 10 of 16 Excel VBA Run-time error '13' Type mismatchThis is a discussion on Excel VBA Run-time error '13' Type mismatch within the http://www.mrexcel.com/forum/excel-questions/605786-excel-visual-basic-applications-run-time-error-13-type-mismatch.html Excel Questions forums, part of the Question Forums category; Hi! I created a macro for a file and first it was working fine, but today I've been oppening and ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Jan 16th, 2012,02:32 PM #1 diogoo New Member Join Date Jan 2012 Posts 4 Excel VBA Run-time error 13 error '13' Type mismatch Hi! I created a macro for a file and first it was working fine, but today I've been oppening and restarting the file and macro hundreds of times and I'm allways guetting the following error: Excel VBA Run-time error '13' Type mismatch I didn't change anything in the macro so dont know why am I gueting the error. Furthermore it takes ages to update the macro everytime I put it running (the macro has to run about time error 13 9000 rows). The error is in the in red part. VBA: Sub k() Dim x As Integer, i As Integer, a As Integer Dim name As String name = InputBox("Please insert the name of the sheet") i = 1 Sheets(name).Cells(4, 58) = Sheets(name).Cells(4, 57) x = Sheets(name).Cells(4, 57).Value Do While Not IsEmpty(Sheets(name).Cells(i + 4, 57)) a = 0 If Sheets(name).Cells(4 + i, 57) <> x Then If Sheets(name).Cells(4 + i, 57) <> 0 Then If Sheets(name).Cells(4 + i, 57) = 3 Then a = x Sheets(name).Cells(4 + i, 58) = Sheets(name).Cells(4 + i, 57) - x x = Cells(4 + i, 57) - x End If Sheets(name).Cells(4 + i, 58) = Sheets(name).Cells(4 + i, 57) - a x = Sheets(name).Cells(4 + i, 57) - a Else Cells(4 + i, 58) = "" End If Else Cells(4 + i, 58) = "" End If i = i + 1 Loop End Sub Do you think you can help me? I'm using excel 2010 on windows 7. Thanks a lot Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Jan 16th, 2012,02:58 PM #2 diogoo New Member Join Date Jan 2012 Posts 4 Re: Excel VBA Run-time error '13' Type mismatch I've searched on several websites but none of the "Run-time error '13' Type mismatch" was like this one... Anyone with any idea how to solve it? Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Jan 16th, 2012,03:4