'© 2022 PTC Inc. All Rights Reserved. Sub Msg(m) WScript.Echo(m) End Sub Dim fileSystemObject Set fileSystemObject = CreateObject("Scripting.FileSystemObject") Dim dirScript dirScript = fileSystemObject.GetParentFolderName(WScript.ScriptFullName) Dim strMessageCurrenyDirectory strMessageCurrenyDirectory = "Mathcad Prime launcher. Click OK and wait" & "..." & vbcrlf & vbcrlf & "Current path: " & dirScript Msg strMessageCurrenyDirectory ' Get the Mathcad Prime application object: Set mathcad = CreateObject("MathcadPrime.Application") mathcad.Visible = true mathcad.Activate() Dim strMessage strMessage = "Mathcad Prime was started successfully: " & mathcad.GetVersion() Msg strMessage ' Open the worksheet: Set worksheet = mathcad.Open(fileSystemObject.BuildPath(dirScript,"CH1_Press_to_120fsw-59F (4-03-20) UNCLASS.mcdx")) worksheet.SetTitle("Title from VB Script") ' Close Mathcad Prime if possible: Dim strMessageToClosePrime strMessageToClosePrime = "Mathcad Prime will be closed if all open modified worksheets are saved and there are no another COM Clients." & vbcrlf & vbcrlf & "Pay attention: if cancel the closing of any modified worksheet then Mathcad Prime remains open." Msg strMessageToClosePrime mathcad.CloseAll(1) mathcad.Quit(2)