Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
J-Camper
in reply to: J-Camper

Okay, I got this thing working without breaking.  I want to add a wait loop in case the timer runs out but I am working in a different document at the time, but ith keeps skipping through my loop:

 

102 ' Waiting till part can be saved, then saving

' Get the Active part document.
Dim CurrDoc As Inventor.Document
Set CurrDoc = invApp.ActiveDocument

    Do While CurrDoc <> ThisDoc
        DoEvents    ' Yield to other processes.
        Set CurrDoc = invApp.ActiveDocument
    Loop

        ThisDoc.Save2 (True) 'Saving file at end of timer

'End 102 Waiting till part can be saved, then saving

it is not saving the file because i'm not active in ThisDoc when the timer runs out, and carries on to my restart MsgBox.