Results 1 to 8 of 8

Thread: [RESOLVED] Run Time error -624820215 (dac20009)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2014
    Posts
    26

    Resolved [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

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jul 2014
    Posts
    26

    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).

  3. #3
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jul 2014
    Posts
    26

    Re: Run Time error -624820215 (dac20009)

    Quote Originally Posted by Siddharth Rout View Post
    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?

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Run Time error -624820215 (dac20009)

    but is this the way?
    not the best
    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

  6. #6
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    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

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jul 2014
    Posts
    26

    Re: Run Time error -624820215 (dac20009)

    Quote Originally Posted by Zvoni View Post
    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?

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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
  •  



Click Here to Expand Forum to Full Width