How to check for availability activeX control

  • Thread starter Thread starter Emile van Mierlo
  • Start date Start date
E

Emile van Mierlo

Hello Group,



When distributing Excel projects with non-standard activeX controls I need
to make sure that they're installed before calling the control.

For example, the calendar control is a nice control, but it can be missed if
not available. I would like to check if the calendar is available, and only
then call it.



Does anybody know if this can be checked with Excel VBA, and how?



Thanks a lot.



Emile van Mierlo
 
Can you not just set an object variable for the object, and test that it is
not Nothing.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Can you not just set an object variable for the object, and test that it
is
not Nothing.

Yes I can. I was thinking of checking the registry for it, but this works
just as well. Thanks for suggesting Bob.



Public Function hasCalendar() As Boolean
Dim obj As Object

On Error Resume Next
Set obj = CreateObject("MSCAL.Calendar")

hasCalendar = Not obj Is Nothing
Set obj = Nothing

End Function

Emile
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top