View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Checking & installing references as part of on_open

Use late binding.

Dim oOLApp as Object

with

Set oConn = CreateObject("Outlook.Application")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"KR" wrote in message
...
I have a macro that access MS Outlook data from Excel (mixed platform,

users
may be using Win2K or WinXP and O2K or OXP)

Is there a way, during the on_open procedure, to have the VBA code check

for
a reference to outlook, and if there isn't one "check the box" to activate
the reference? What makes this more problematic is the multiple platforms,
so I'm not sure how to hardcode the multiple possible reference names. I

am
sticking with early binding, because so far I haven't learned enough to

make
late binding work (I've tried).

The idea of walking every user through the process of opening up the VBE,
adding the reference, etc. is daunting, so I'd like to do this

automatically
if possible.

Many thanks,
Keith

--
The enclosed questions or comments are entirely mine and don't represent

the
thoughts, views, or policy of my employer. Any errors or omissions are my
own.