0

In an Excel 2013 Workbook I use the Microsoft Outlook 15.0 Object Library and it compiles fine and the workbook has no issues. When I open that same workbook on another computer using Excel 2016 the reference automatically changes to Microsoft Outlook 16.0 Object Library and there are no compiler or usage issues. If I save or compile that same workbook when using Excel 2016 and re-open it on a computer using Excel 2013 the workbook halts with a compiler message that a reference is missing and its the MS Outlook reference that's missing. Does this have to do with Late and Early Binding or is there another method to avoid this issue.

Shia

On Error Resume Next
Set OutlookApp = GetObject(, "Outlook.Application")
On Error GoTo 0
If OutlookApp Is Nothing Then

'MsgBox "Outlook is not open, not setup or not the default email client." & vbCrLf & "Outlook must be installed, setup and open to use this feature.", vbOKOnly + vbExclamation, "Outlook not open"

Set OutlookMessage = Nothing
Set OutlookApp = Nothing
Exit Sub
End If

My problem is I cannot figure a way to check if Outlook is completely installed and the profile is setup. If outlook is completely installed everything is OK but if office is installed on the computer but outlook has not been setup completely the code initiates the outlook setup wizard and if the user does not complete the wizard the code halts with an automation error. I need to check if outlook has a default profile first before using this feature.

Community
  • 1
  • 1
FTSC
  • 200
  • 2
  • 8
  • 1
    Please see: http://stackoverflow.com/questions/9879825/how-to-add-a-reference-programmatically – Sorceri Feb 27 '17 at 23:50
  • Yes, it is related to your code most likely using **Early Binding**. You have 2 ways to overcome: **1)** Read and implement the code in the link (in the comment above), it invloves adding more refferences to your project. **2)** Switch to **Late Binding**. You need to share your code if you want our help. – Shai Rado Feb 28 '17 at 06:06

0 Answers0