Magic_Doctor
Board Regular
- Joined
- Mar 18, 2009
- Messages
- 56
Hello,
By means of an icon, to which a macro is assigned, I open the Windows calculator when I click on this icon:
It works very well.
The problem is that if I click, for example, 10 times on the icon, 10 calculators will be opened. We can thus end up with a lot of open calculators… What I would like is that once the calculator is open, we can no longer open others. Is there a way to know if the calculator is open? Suppose this is possible, then it would suffice to assign the result to a boolean variable (CalcOpen) and write this in the macro so that there can only be one open calculator:
Thank you in advance for all responses.
By means of an icon, to which a macro is assigned, I open the Windows calculator when I click on this icon:
VBA Code:
Sub Calculatrice()
‘Excel 2007
Shell "c:\windows\system32\calc.exe"
End Sub
The problem is that if I click, for example, 10 times on the icon, 10 calculators will be opened. We can thus end up with a lot of open calculators… What I would like is that once the calculator is open, we can no longer open others. Is there a way to know if the calculator is open? Suppose this is possible, then it would suffice to assign the result to a boolean variable (CalcOpen) and write this in the macro so that there can only be one open calculator:
VBA Code:
Sub Calculatrice()
If CalcOpen Then Exit Sub
Shell "c:\windows\system32\calc.exe"
End Sub