|
-
Jul 5th, 2007, 10:55 AM
#1
Thread Starter
Hyperactive Member
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
-
Jul 5th, 2007, 01:25 PM
#2
Re: Automation Err when creating outlook object
Do they have Outlook installed on those systems?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 5th, 2007, 01:37 PM
#3
Thread Starter
Hyperactive Member
Re: Automation Err when creating outlook object
Yes, everyone has Outlook.
-
Jul 5th, 2007, 01:40 PM
#4
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?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 5th, 2007, 02:23 PM
#5
Thread Starter
Hyperactive Member
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.
-
Jul 5th, 2007, 02:28 PM
#6
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
Last edited by RobDog888; Jul 5th, 2007 at 02:31 PM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|