Automation Err when creating outlook object
I have an Excel file that has a macro that attaches one of the spreadsheets to an email. Everyone using this has the same version of Office/Outlook (2003). Some people can run it perfectly and other get an error '1004' - Automation Error. Can not find object. And it stops on the following line of code set OutlookMail = CreateObject("Outlook.Application").
Anyone have any ideas why this would work on some pc's but not others?
Code:
Dim OutlookMail As Object
Set OutlookMail = CreateObject("Outlook.Application")
Dim Mail As Object
Set Mail = OutlookMail.createitem(olMailItem)
Mail.Subject = "Accounting numbers for budget"
Mail.Display
Mail.Attachments.Add Module1.Temp
Re: Automation Err when creating outlook object
Do they have Outlook installed on those systems?
Re: Automation Err when creating outlook object
Yes, everyone has Outlook.
Re: Automation Err when creating outlook object
Do they have the sme version? Are they all updated with the latest Office Updates? It does sound like Outlook is either missing or damaged on those systems.
Why not just use Excels built in feature?
Re: Automation Err when creating outlook object
They are all new PC's within the past year. They came with office already loaded on them. It's possible that some need a patch. I will try using the built in Excel function. Thanks.
Re: Automation Err when creating outlook object
I forgot the link to my FAQ on that item ;)
http://vbforums.com/showthread.php?t=402068
Since they came preloaded I would assume that somewhere something may have went wrong and messed up the Office configuration. Office Update should fix whatever may be wrong