Re: test whether ocx is registered from VB, possible?



On Sat, 09 Jul 2005 13:40:48 -0700, mscir <mscir@xxxxxxxxx> wrote:
>have 0 bugs) for now I will register it every time the program is run.
>I'm working through the other approaches to see if I can trap an error
>in the case of an unregistered condition, since this seems preferable to
>writing the same value to the registry over and over.

Stick sthing like this in Main() in the starting module:

Sub Main

On Error Goto BadOCX

Dim MyOCX As SomeOCX.SomeObj
Set MyOCX = CreateObject("SomeOCX.SomeObj")
MyOCX = Nothing

Exit Sub

BadOCX:
MsgBox "An OCX could not be loaded"
End

End Sub
.



Relevant Pages

  • Re: RFC: utils.pm
    ... but I'm tired to writing this god damn line each time I want to ... sub as_boolean { ... "Scientists are complaining that the new "Dinosaur" movie shows dinosaurs with lemurs, who didn't evolve for another million years. ...
    (comp.lang.perl.misc)
  • Re: OnKey problem
    ... Okay, I want to trap only Alt-n at this point, although later I may want to add other similar combinations. ... Private Sub TextBox1_KeyDown ... Static half1 As Boolean ... Gary''s Student - gsnu200827 ...
    (microsoft.public.excel.programming)
  • Re: Function versus Procedure
    ... of a sub). ... If you're not writing bad code, i.e., you're properly ... just more consistent coding and less problematic in the way it's ... The recommendation violates every canon of good coding I can think ...
    (microsoft.public.access.tablesdbdesign)
  • RE: Matching user input to number in range
    ... I needed and finding out how to trap with the IF statement, ... Sub TrapNoFind() ... I need to match cell content, ... I figure the WHAT, SEARCHORDER, ...
    (microsoft.public.excel.programming)
  • Re: VBA dates versus Excel dates
    ... I used the .Value2 property when writing the dates to the worksheet. ... End Sub ... Jon Peltier, Microsoft Excel MVP ... This post is a suggestion for Microsoft, ...
    (microsoft.public.excel.programming)

Loading