Question : Prevent ambiguous error

Hi Experts,

I would like to request Experts help. How to combine the attached  codes in  Outlook (ThisOutlookSession) to avoid ambiguous error?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
Dim WithEvents olkFolder As Outlook.Items

Private Sub Application_Quit()
    Set olkFolder = Nothing
End Sub

Private Sub Application_Startup()
    Set olkFolder = Session.GetDefaultFolder(olFolderSentMail).Items
End Sub

&

Dim objMT As MyTracker

Private Sub Application_Quit()
    Set objMT = Nothing
End Sub

Private Sub Application_Startup()
    Set objMT = New MyTracker
End Sub

Answer : Prevent ambiguous error

Merge the two subs as follows ... i.e. deklete the code in the module and replace with the snippet.

Chris
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Dim WithEvents olkFolder As Outlook.Items
Dim objMT As MyTracker

Private Sub Application_Quit()
    Set olkFolder = Nothing
    Set objMT = Nothing
End Sub

Private Sub Application_Startup()
    Set olkFolder = Session.GetDefaultFolder(olFolderSentMail).Items
    Set objMT = New MyTracker
End Sub
Random Solutions  
 
programming4us programming4us