If a previous session of SAS is open, when I use CreateObject("SAS.Application"), it connects to the previous session of SAS instead of opening a new session. If multiple sessions are open, each run of the CreateObject code runs in the successive instance until it has been run in all instances, at which time the next run will create a new instance of SAS, e.g. if I have 3 open sessions, the first time I run the CreateObject code, it runs in session 1, the next time in session 2, the next time in session 3 and the next time it opens a new SAS instance. Does anyone know how I can modify the code to open and use a new session each time it is run? VBA: Sub run_SAS() Dim SAS As Object Set SAS = CreateObject("SAS.Application") SAS.Visible = True SAS.Submit ("%let gVar=Something;") '... Set SAS = Nothing End Sub
... View more