Ending a dll program

A

avi

hello,

I call a DLL from VBA. In this DLL(VB6), the program must stop
completely and exit if some condition holds

With EXE application, the END statement seems to work for me, but
compiling to DLL rejects the END statement.

How can I quit the program within the DLL?

Thanks a lot
Avi
 
P

Peter T

First you should never use the "End" statement, in VBA or VB6. The common
analogy is that's like stopping your car by driving into a brick wall, then
leaving your foot on the pedal with the engine running.

To get a VB6 dll running, for want of a better term, you will have created
an instance of a public entry class in the dll, holding it with a reference
in your VBA (unless it's a Com-dll). In your dll, clear down any internal
object references (eg module level object variables, running forms, etc),
then in your VBA set the reference to Nothing (or allow the reference to go
out of scope).

Regards,
Peter T
 

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