-
Sep 1st, 2014, 03:39 AM
#1
Thread Starter
Junior Member
[RESOLVED] Run Time error -624820215 (dac20009)
Hi Guys,
It is me again.
I have created macro with aims at extracting the headers of the outlook's columns (rec. date, to, from, size, category etc)
However, today we had identical errors with 2 of the teams in the company which use it.
(End date and start date is the time period we use to extract for example from 28.08 to 30.08)
Code:
Dim extractByCriteria As Variant
Dim ExtractBy as String
'Item type check
If TypeName(myItems(itemCnt)) = "MeetingItem" Or TypeName(myItems(itemCnt)) = "ReportItem" Then
GoTo NonEmail
End If
Set msg = myItems(itemCnt)
'Item date check
extractByCriteria = msg.ItemProperties.Item(ExtractBy) 'I got the error on this line.
If extractByCriteria > EndDate Or extractByCriteria < StartDate Then
GoTo NonEmail
End If
It will be highly appreciated if you can advise how I can avoid this error. It seems to me that some strange email type item has entered the mailboxes for the period and the macro cannot recognize it.
Please help!
Last edited by Siddharth Rout; Sep 1st, 2014 at 03:26 PM.
Reason: Added Code Tags
-
Sep 1st, 2014, 09:08 AM
#2
Thread Starter
Junior Member
Re: Run Time error -624820215 (dac20009)
Anyone has any idea? I will appreciate if you can advise the reason why these negative value run time errors occur (as the seem to be the worst).
-
Sep 1st, 2014, 03:26 PM
#3
Re: Run Time error -624820215 (dac20009)
Where are you setting the value of "ExtractBy" ? From what I see int he code above ExtractBy = ""
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread "Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Sep 1st, 2014, 03:45 PM
#4
Thread Starter
Junior Member
Re: Run Time error -624820215 (dac20009)
Originally Posted by Siddharth Rout
Where are you setting the value of "ExtractBy" ? From what I see int he code above ExtractBy = ""
The extract by is set earlier in the code -it is string value of a cell - usually received time or task completed time (the whole code is quite long so I do not want to waste your time with it).
However, i missed to mention that the error actually is:"one or more items in the folder you synchronized do not match"
It will give me error during the mailitem checks the macro performs as a loop while extracting:
Code:
'Item type check
If TypeName(myItems(itemCnt)) = "MeetingItem" Or TypeName(myItems(itemCnt)) = "ReportItem" Then
GoTo NonEmail
End If
Set msg = myItems(itemCnt)
extractByCriteria = msg.ItemProperties.Item(ExtractBy)
If extractByCriteria > EndDate Or extractByCriteria < StartDate Then
GoTo NonEmail
End If
'check for encryption
If msg.ItemProperties.Item("MessageClass") = "IPM.Note.SMIME.MultipartSigned" Then
GoTo NonEmail
End If
(Nonemail reduces the total count of the loop int count as it goes just before "next" - if 20 emails for the period are in the folder and it finds 2 nonemails it will extract 18).
So the question is if there is a way I can make the macro ignores the non synced emails? I can always set "on error goto nonemail" but is this the way?
-
Sep 1st, 2014, 04:21 PM
#5
Re: Run Time error -624820215 (dac20009)
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 2nd, 2014, 08:46 AM
#6
Re: Run Time error -624820215 (dac20009)
Why not use an OERN right before the loop, with an On Error Goto 0 after the loop?
He could even check inside the loop for the error and count the failed extraction attempts, like
"18 Items successfully extracted, 2 failed" or something like that.
And i agree with pete: try to avoid Goto.
To avoid it he would have to reverse the check-conditions in his If-Clauses
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Sep 2nd, 2014, 01:10 PM
#7
Thread Starter
Junior Member
Re: Run Time error -624820215 (dac20009)
Originally Posted by Zvoni
Why not use an OERN right before the loop, with an On Error Goto 0 after the loop?
He could even check inside the loop for the error and count the failed extraction attempts, like
"18 Items successfully extracted, 2 failed" or something like that.
And i agree with pete: try to avoid Goto.
To avoid it he would have to reverse the check-conditions in his If-Clauses
Hmm I am not quite familiar with the way to do this. I can reverse the if statements and to exclude GOTo but how to make it give me the count of non extracted items?
-
Sep 2nd, 2014, 04:13 PM
#8
Re: Run Time error -624820215 (dac20009)
but how to make it give me the count of non extracted items?
in the else
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|