View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default GetObject method not work after Call Shell Method

didn't do quite what i expected but doevents definitely changed things up a
bit. I think I can work through it now.
Thanks again Tom

--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"Tom Ogilvy" wrote:


Perhaps something like this will work:

set obj = Getobject(,"Outlook.Application")
if obj is Nothing then
Call Shell("dir string")
do
Doevents
set obj = Getobject(,"Outlook.Application")
Loop while obj is nothing
End if


--
Regards,
Tom Ogilvy



"ben" (remove this if mailing direct) wrote in
message ...
Trying to grab a reference to Outlook.
I first use the Getobject(,"Outlook.Application") method, this works if
outlook is open but if's it's not, I use Call Shell("dir string") to open
Outlook then use GetObject again to attempt to grab reference. This does

not
work. Outlook will open, and be running fine, but VBA refuses to

acknowledge
it being open, UNLESS I step through the code.
it's almost like it reads the State of office apps before it runs and will
not change that state unless, i step through, ie... It says outlook is

open
and won't recheck, even if it is opened by code.
I can not use CreateObject for the last service pack microsoft released
killed that function for outlook.
any thoughts?





--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?