LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Cater for unregistered DLL

Normally my VB6 ActiveX DLL should be registered in user's system, and a
reference set to it in my project. However, before running my main routine,
I want to ensure it is indeed registered and avert all the problems of a
missing ref.

I have something like this, which fails -

'Module1
Public mbDllReg As Boolean

Sub Auto_Open()
Dim obDLL As Object

On Error Resume Next

Set obDLL = CreateObject("MyDLL.Some")

If Not obDLL Is Nothing Then
Set obDLL = Nothing
mbDllReg = True
End If

End Sub

Sub StartHere()
If mbDllReg Then
DoMain
Else
MsgBox "DLL not registered"
End If
End Sub

'Module2
Public pDllRef As MyDLL.Some

Sub DoMain()

Set pDdllRef = New MyDLL.Some
' do stuff

End Sub

If I unregister the dll before opening my file, when the wb opens and the
Open routine runs, the code breaks on "pDllRef As MyDLL.Some" at the top of
Module2.

If I only declare the DllRef at procedure level - no problem, but I do need
a public ref to the DLL-class.

FWIW, Module1 is the first module added to the project, and no difference if
project is/not pre-compiled.

Any solution much appreciated,
Peter T



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adjusting prizes to cater for ties Max Excel Worksheet Functions 2 October 12th 05 02:07 PM


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"