Macro Issue - the object invoked has disconnected from its clients

Macro Issue - the object invoked has disconnected from its clients

Anonymous
Not applicable
906 Views
2 Replies
Message 1 of 3

Macro Issue - the object invoked has disconnected from its clients

Anonymous
Not applicable

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

 

0 Likes
907 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Just want to add some screenshots

2015-05-05 06_33_43-Autodesk Inventor Professional 2015 - [Home].jpg

 

 

 

Then when I click debug:

 

2015-05-05 06_34_42-Microsoft Visual Basic for Applications - WIP.ivb [break] - [ExportIDW (Code)].jpg

 

 

 

And crash:

 

2015-05-05 06_35_02-Program Manager.jpg

 

 

 

Code:

2015-05-05 06_37_19-Microsoft Visual Basic for Applications - WIP.ivb - [ExportFromIDW (Code)].jpg

0 Likes
Message 3 of 3

Anonymous
Not applicable

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?

0 Likes