I have a code that opens an external programme's application window as a VBA object. The code opens a GUI in that external programme that the user then interacts with. I currently have an issue where the code runs through to the end of the sub routine and subsequently closes the object I have created. As an interim measure, I have added a 'Stop' command but this is untidy allowing users to edit the code.
Anyone have any ideas that would allow me to run the code in the background but keep the object open indefinitely?
Sub Exit_Click()
Dim MatLab As Object
Dim Result As String
Set MatLab = CreateObject("Matlab.Application")
'Calling MATLAB function from VB
Result = MatLab.Execute("cd \\ariaimg\va_data$\RPM_Database\RPM_database\RPM_Evaluation")
Result = MatLab.Execute("RPM_GUI")
Stop
End Sub