i have this piece of code, it works sometimes, sometimes it gives me an error and if i click debug and then run again it works, sometimes i have to do this a couple times, sometimes it doesnt work at all, on top of that its completely random as to when these happen. ive tried restarting the program, rebooting my computer, doing neither and its still completely random as to when it happens. i think that im going to cry :-(
heres the code:
Public Sub getdwg()
Dim working As DrawingDocument
Set InvApp = GetObject(, "Inventor.Application")
Set working = InvApp.Documents.Add(kDrawingDocumentObject, ("w:\Inventor\Templates\LHW.idw"), True)
Set dwgref = ThisApplication.ActiveDocument
End Sub
anyone know why this might not work so well? by the way, invapp is defined as inventor.applicaion, and dwgref is defines as a dreawingdocument. bot are in the declarations area.
heres the code:
Public Sub getdwg()
Dim working As DrawingDocument
Set InvApp = GetObject(, "Inventor.Application")
Set working = InvApp.Documents.Add(kDrawingDocumentObject, ("w:\Inventor\Templates\LHW.idw"), True)
Set dwgref = ThisApplication.ActiveDocument
End Sub
anyone know why this might not work so well? by the way, invapp is defined as inventor.applicaion, and dwgref is defines as a dreawingdocument. bot are in the declarations area.