upobDaPlaya
asked on
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,,,,,,,,,o ther Dim Outlook statements, etc.
Set appOL = New Outlook.Application: Set appMail = appOL.CreateItem(0)
Dim applOL as Outlook Application, appMail As Outlook.MailItem,,,,,,,,,o
Set appOL = New Outlook.Application: Set appMail = appOL.CreateItem(0)
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Removing and reselecting worked....bizarre..thanks imnorie for reaching out though
Note that applOL <> appOL. Fix that misspelling.
Also, your dim statement should have "Outlook.Application", not "Outlook Application".