View Single Post
 
Old 07-16-2014, 07:50 AM
WeDonNeedNoSteenkgRibbons's Avatar
WeDonNeedNoSteenkgRibbons WeDonNeedNoSteenkgRibbons is offline Windows XP Office 2003
Novice
 
Join Date: Jul 2014
Posts: 23
WeDonNeedNoSteenkgRibbons is on a distinguished road
Default Peculiar Outlook VBA item, Application_Quit

Below is my in class module Class1 in Project1 (VbaProject.OTM) (I'm just reading from the Project pane). When I close outlook, I get
Code:
Run-time error '424':
Object required.
(2 buttons, debug and end)
If you click debug, you see the For Each line highlighted in yellow as it's stopped there, and more peculiarly, one second later, the VBA window disappears and you get Dr. Watson asking if you want to report the crash to MS.
Code:
Private Sub Application_Quit()
    Dim olItems As Outlook.Items, olItem As Object, i As Integer
    
    For Each olItem In olItems
        i = i + 1
    Next
End Sub
OL 2007. It happens 100% of the time as I quit Outlook. Advice?
Reply With Quote