I have incorporated some code into a spreadsheet that when initiated is supposed to check whether Outlook is already open and if not then open it. But nothing seems to be happening. Could someone take a look?
Private Sub Command1_Click()
Dim OlApp As Outlook.Application
On Error Resume Next
Set OlApp = GetObject(, "Outlook.Application")
If Err.Number = 429 Then 'Outlook not running, so start it
MsgBox "Starting Outlook now..."
Set OlApp = New Outlook.Application
Set OlApp = Nothing