I'm using this script to auto save the program for each part run:
While running a part, I was editing another program offline. It got to the point in the program for it to auto-save the program and I noticed that the offline program was the one that got saved instead of the program that was running.
I assume this is because of "App.ActivePartProgram"
Is there a way to make sure this problem doesn't happen?
Code:
Sub Main(strFile As String) Dim App As Object Dim Part As Object Dim bolPassFail As Boolean Set App = CreateObject ("PCDLRN.Application") Set Part = App.ActivePartProgram bolPassFail = Part.SaveAs (strFile) 'Cleanup Set App = Nothing Set Part = Nothing End Sub
I assume this is because of "App.ActivePartProgram"
Is there a way to make sure this problem doesn't happen?