dealing with missing references

E

eric

Hi!

I have a problem where I reference som dll-files that are available when I
work connected to the network, but not when I work off line. Hence when I
use Word off line I get an error.

Any ideas? Trap it through on error? Something else?

Best
/e
 
S

Shauna Kelly

Hi Eric

It's not really possible to trap this as an error, because it's a
compile-time error, not a run-time error. What I do in this circumstance is
to use late binding. (See
http://www.word.mvps.org/FAQs/InterDev/EarlyvsLateBinding.htm for info) with
something like this:

Dim clsMyThing As Object

On Error Resume Next
Set clsMyThing = CreateObject("DLLName.ClassName")
On Error GoTo 0

If clsMyThing Is Nothing Then
'DLL is not available
Else
clsMyThing.MyMethod whatever
End If

Set clsMyThing = Nothing

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 

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

Top