I have some vbs/vba scripts running from time to time. But I don't want next vbscript to be proceeded while another either vba- or vbscript is running. There is no problem to determine if another vbscript is running and delay execution of current vbscript:
Set objSWbemServices = GetObject ("WinMgmts:Root\Cimv2")
Set colProcess = objSWbemServices.ExecQuery _
("Select * From Win32_Process where name = 'wscript.exe'")
Do While colProcess.Count > 1
WScript.Sleep 10000
Set colProcess = objSWbemServices.ExecQuery _
("Select * From Win32_Process where name = 'wscript.exe'")
Loop
But I can't find a particular process of vba script running in Excel. How one can check in vbscript if vba script is running?