Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro Issue - the object invoked has disconnected from its clients

2 REPLIES 2
Reply
Message 1 of 3
nike_bytom
745 Views, 2 Replies

Macro Issue - the object invoked has disconnected from its clients

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

 

2 REPLIES 2
Message 2 of 3
nike_bytom
in reply to: nike_bytom

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

Message 3 of 3
nike_bytom
in reply to: nike_bytom

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?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report