Here is my solution: Count the number of SAS sessions before attempting to create a new one. Loop through the CreateObject until a new one is created. If there are no previous sessions or the previously sessions have already been looped through by a previous calls, it immediately creates one.
Function get_num_sas_sessions() As Integer
Dim objWMIService As Object
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Dim colItems
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE name = 'SAS.EXE'")
Dim intSASCount As Integer
intSASCount = 0
For Each itProcess In colItems
intSASCount = intSASCount + 1
Next
Set objWMIService = Nothing
Set colItems = Nothing
get_num_sas_sessions = intSASCount
End Function
Sub run_SAS()
Dim SAS As Object
Dim intNumSAS As Integer
intNumSAS = get_num_sas_sessions()
Do Until get_num_sas_sessions() > intNumSAS
Set SAS = CreateObject("SAS.Application")
Loop
SAS.Visible = True
SAS.Submit ("%let gVar=Something;")
'...
Set SAS = Nothing
End Sub