View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Ending a dll program

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

"avi" wrote in message
...
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