sous2817
Well-known Member
- Joined
- Feb 22, 2008
- Messages
- 2,276
Hello everyone,
I'm tinkering with Google Earth and I'm struggling to check if the application is installed on the user's machine. I know when you go to a google earth page and you don't have it installed, you're given the option to install it. The problem with that is, you need to have admin rights in order to install, which we don't have on our work machines. My goal is to capture the fact that they don't have it installed at macro execution time rather than wait for the dialog box to open on a website, ask if they'd like to install google earth, then have it crap out during installation.
So if there's some error check at the start, I can handle the issue before it gets to the "installation failed" message.
I found this bit of code online:
which works if you know the application name. Unfortunately, it's not as simple as replacing "Outlook.Application" with "GoogleEarth.Application".
So I'm wondering if anyone has any ideas on how to test if an application is installed...
Thanks in advance,
sous
I'm tinkering with Google Earth and I'm struggling to check if the application is installed on the user's machine. I know when you go to a google earth page and you don't have it installed, you're given the option to install it. The problem with that is, you need to have admin rights in order to install, which we don't have on our work machines. My goal is to capture the fact that they don't have it installed at macro execution time rather than wait for the dialog box to open on a website, ask if they'd like to install google earth, then have it crap out during installation.
So if there's some error check at the start, I can handle the issue before it gets to the "installation failed" message.
I found this bit of code online:
Code:
Function ApplicationIsAvailable(ApplicationClassName As String) As Boolean
' returns True if the application is available
' example: If Not ApplicationIsAvailable("Outlook.Application") Then Exit Sub
Dim AnyApp As Object
On Error Resume Next
Set AnyApp = CreateObject(ApplicationClassName)
ApplicationIsAvailable = Not AnyApp Is Nothing
Set AnyApp = Nothing
On Error GoTo 0
End Function
which works if you know the application name. Unfortunately, it's not as simple as replacing "Outlook.Application" with "GoogleEarth.Application".
So I'm wondering if anyone has any ideas on how to test if an application is installed...
Thanks in advance,
sous