Why a type mismatch on Excel VBA that creates an Outlook email

I have some code within Excel that creates an email, but I am getting a Type mismatch error.  I checked and I appear to have all the correct references set.  It is failing at SetappMail = appOL.CreateItem(0)

Dim applOL as Outlook Application, appMail As Outlook.MailItem,,,,,,,,,other Dim Outlook statements, etc.

Set appOL = New Outlook.Application: Set appMail = appOL.CreateItem(0)
Who is Participating?
Patrick MatthewsConnect With a Mentor Commented:
Could be a problem with the reference.  Remove the reference, add it back, and compile.
Patrick MatthewsCommented:
Turn on Option Explicit :)

Note that applOL <> appOL.  Fix that misspelling.

Also, your dim statement should have "Outlook.Application", not "Outlook Application".
upobDaPlayaAuthor Commented:
Sorry I should have included all the code, but on a different PC.

I used Option Explicit
appOL is not mispelled in the original code
The DIM statement does have "Outlook.Application"

Any other suggestions...Note this same code works for others..I am the only one getting the type mismatch error
NorieConnect With a Mentor VBA ExpertCommented:
Can we see the code, including the declarations?
upobDaPlayaAuthor Commented:
Removing and reselecting worked....bizarre..thanks imnorie for reaching out though
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.