2009-10-02 23:27 UTC
Hi guys, I use this small VBA code to close my current DWG & open anther DWG.
Now that VBA is semi removed from Acad2010 (yes I know I can download it), I'd like to kill all my VBA code, if possible.
Does anyone have a way to open a DWG & close the calling DWG with VLisp?
Now that VBA is semi removed from Acad2010 (yes I know I can download it), I'd like to kill all my VBA code, if possible.
Does anyone have a way to open a DWG & close the calling DWG with VLisp?
Public Sub CloseCurrentOpenPath()
Dim ad As AcadDocument
Dim pth As String
Dim CloseFile As String
Dim Response As Integer
Set ad = ActiveDocument
pth = ad.GetVariable("users2")
If Not ad.GetVariable("DBMOD") = 0 Then
Response = MsgBox("Do you want to save changes to " & ad.FullName & "?", vbYesNoCancel + vbExclamation + vbDefaultButton1, "TMaCAD")
If Response = vbYes Then
If ad.GetVariable("WRITESTAT") = 1 Then
ad.Save
End If
ElseIf Response = vbCancel Then
Exit Sub
End If
End If
ad.Close False
If pth <> "" Then
Application.Documents.Open pth
End If
End Sub
