TheSwamp
Code Red => VB(A) => Topic started by: Amsterdammed on June 05, 2005, 08:01:31 AM
-
Morning Folks,
I’m desperately trying to get into VBA as quick as possible, so I’m not depending on my lisp skills only.
I need to understand how the “BeginQuit” Handler works, since I write a VBA program that must start when acad quits.
Anybody out there who can help??
Bernd
-
Hi , Bernd
I suppose you mean the BeginClose event for a document.
"BeginQuit" is not availeble in vba
If you open the VBA IDE (left Alt-F11)
you'll see ThisDrawing in your project browser. double click it and place this code:
Option Explicit
Private Sub AcadDocument_BeginClose()
'do your stuff
End Sub
This will fire just before the document is closed. Acad itself will remain running.
-
I'm searching for a event that fires when Acad is shut down. End of the day, drafter goes home and has to fill in a form.
Are you sure there is no VBA event for? I know that there is no vlisp event for in A2002, in 2006 it works with the command reactor for quit, but in my company we change only next year, so i need something for A2002.
Bernd
-
I suppose you mean the BeginClose event for a document.
"BeginQuit" is not availeble in vba
Decent & Bernd, for both of your benefit here is a snip from the VBA Developer Reference in R2002
BeginQuit Event
Triggered just before an AutoCAD session ends or a document closes.
See Also | Example
Signature
object.BeginQuit (Cancel)
object
Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.
Cancel
Boolean; output from the handler
TRUE: Aborts the shutdown of AutoCAD.
FALSE: Allows the shutdown of AutoCAD to continue.
Remarks
The BeginQuit event marks the end of the AutoCAD session.
-
:D Jeff, you saved my ass.
Thanks a lot, that approach works.