Hi All,
I have issue with my simple macro that generate pdf or dxf file from the drawing, then Check in drawing to the vault and after that closing the current drawing/document.
PDF or DXF generator code... 'Vault Sub CheckInVault() ThisApplication.ActiveDocument.Save Set ctrdef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop") If Not ctrdef Is Nothing Then ctrdef.Execute End If End Sub ' Close Public Sub CloseIDW() Dim IDW As DrawingDocument Set IDW = ThisApplication.ActiveDocument IDW.Close Save = False End Sub 'Macro close Public Sub closeForm() Unload ExportFromIDW End Sub
The code works fine without closing drawing after check in..or with close option but without check in option to the vault . Macro works perfect in debug mode - no errors. If i chose Generate, Check in to vault then close drawing I am getting error after close 'the object invoked has disconnected from its clients' and inventor crash. 😞
I can not find what is causing the iisue beetwen two simple options Check in to the vault and close document.
Any idea?
Thanks
Just want to add some screenshots
Then when I click debug:
And crash:
Code:
Hi guys I just add line to :
Line added : On Error Resume Next Sub ExportIDW() On Error Resume Next ExportFromIDW.Show End Sub
It looks like it works ok now. Is that ok?