AI banned? I asked Bing Chat about this, and with some slight modifications, I got it to work! Here's what I asked:
Q: Using VBA 7.0, what is the code for a macro that 1.) Checks to see if Firefox is open, 2.) If Firefox is open, then stop, 3.) If Firefox is not open, open Firefox, and then stop
A: This code uses Windows Management Instrumentation (WMI) to query for processes running on the computer. It sets the process name to check for as “firefox.exe” and the computer name to check on as “.” (local computer). It then queries for processes with that name and checks if any are running. If Firefox is not running, it starts it up using the objShell.Run method1.
. . . Please see Screenshots on imgur . . .
Q: Using VBA 7.0, what is the code for a macro that 1.) Checks to see if Firefox is open, 2.) If Firefox is open, then stop, 3.) If Firefox is not open, open Firefox, and then stop
A: This code uses Windows Management Instrumentation (WMI) to query for processes running on the computer. It sets the process name to check for as “firefox.exe” and the computer name to check on as “.” (local computer). It then queries for processes with that name and checks if any are running. If Firefox is not running, it starts it up using the objShell.Run method1.
. . . Please see Screenshots on imgur . . .