Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2019, 12:54 PM
BobBridges's Avatar
BobBridges BobBridges is offline Why would GetObject(, "Outlook.Application") fail? Windows 7 64bit Why would GetObject(, "Outlook.Application") fail? Office 2010 32bit
Expert
Why would GetObject(, "Outlook.Application") fail?
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default Why would GetObject(, "Outlook.Application") fail?

I'm writing an Excel program to generate emails for a coworker. It works alright for me, but right at the beginning when he gets to




Set ool = GetObject(, "Outlook.Application")


...it fails for him, "type mismatch" error. He's in Michigan, I'm in NC, so it's impractical for me to run over to his desk to see what's going on. He tells me a copy of Outlook ~is~ running. His Tools / References are the same as mine. I tried getting him to change that statement to


Set ool = CreateObject("Outlook.Application")


...but it just said it couldn't create the object.


I'm not sure even what questions to ask. What ~could~ cause it not to be able to find a copy of Outlook? I'm pretty well convinced that there is something basic I've misunderstood about GetObject and/or CreatObject that would clear this up for me, but I can't see what it might be.
Reply With Quote
  #2  
Old 11-23-2019, 01:33 AM
gmayor's Avatar
gmayor gmayor is offline Why would GetObject(, "Outlook.Application") fail? Windows 10 Why would GetObject(, "Outlook.Application") fail? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

As a rule of thumb, it is preferable to use the function at Test if Outlook is open and open Outlook with VBA to open Outlook, whether it is running or not, however presumably your co-worker has defined ool as an Object?
Code:
Dim ool as Object
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why would GetObject(, "Outlook.Application") fail? Outlook: Hyperlink shows "Microsoft Office" files not "ALL" Elly26 Outlook 5 02-22-2016 02:11 PM
Need help with conditional formatting & returning "Pass" / "Fail Results" in a Column N mikey386 Excel 2 12-11-2014 01:14 PM
remove repeated words with " macro " or " wild cards " in texts with parentheses and commas jocke321 Word VBA 2 12-10-2014 11:27 AM
Why would GetObject(, "Outlook.Application") fail? How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM
"Microsoft Excel Application" missing in the "Component Services" on win08 sword.fish Excel 0 02-26-2010 02:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft