save, close and exit many autocad session with vba code
save, close and exit many autocad session with vba code
(OP)
Presently I’m searching a way to save, close and exit many autocad sessions in VBA. I have to look at the SDI and MDI mode.
I’m sure you will know someone who could help me?
Regards,
Steve
I’m sure you will know someone who could help me?
Regards,
Steve





RE: save, close and exit many autocad session with vba code
CODE
Dim ACad As Object
SessionIsOpen = True
On Error Resume Next
Do While SessionIsOpen
Set ACad = GetObject(, "AutoCad.Application")
If Err.Number <> 0 Then
' AutoCad is not running
SessionIsOpen = False
Else
'AutoCad is running
ACad.Quit
End If
Loop
Err.Clear
On Error GoTo 0
End Sub
RE: save, close and exit many autocad session with vba code
To save the files that are open in each AutoCAD session insert the following code before the line:
ACad.Quit
CODE
For Each Doc In ACad.Documents
Doc.Close SaveChanges:=True
Next
ACad.Quit
.....
DARE TO IMAGINE
mala_rs_singh@rediffmail.com