I am not sure where I got that code from and am currently using a different method to determine if Lotus Notes is running or not.
Before I have my program try to send an email, I have it run this code first.
If Lotus Notes is not running, it ends the program with a warning message.
On Error Goto notesIsNotRunning
Dim notesErr, notesBox
notesErr = "This program requires Lotus Notes to be running on your computer." & vbCrLf & vbCrLf
notesErr = notesErr & "Please open Lotus Notes and try again."
notesBox = MsgBox(notesErr, vbCritical, "Lotus Notes Is Not Open")
If it is running, it calles the sendEmail sub.
I had to add this code to the beginning of the sendEmail sub to get the focus back on Excel.
I have attached a working copy of my email VBA.
AppActivate "Microsoft Excel"