I'm trying to write a program that exports data to Microsoft Excel, and was wondering if there's a simple system call which would tell the program whether Excel was installed on the target system.
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
Is there any other way, for example searching within the registry, to look for the word "Excel"? The above strangeness makes me think that perhaps the version of Office I have is a different version from the one you have?
ElseIf (version.dwPlatformId = 2 And version.dwMajorVersion = 6) Then
' check for win 2000 reg path
End If
End Sub
This you should be able to add on top of the above code I gave you - it's to check which versions of windows you have. I've given you a win2000 example, & you've found the key to you os, can anyone else paste some more excel app registry key locations?
Last edited by alex_read; Sep 9th, 2002 at 05:46 AM.
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
I'm suprised I'm going to write this one, but it's an "if all else fails " bit of code which'll do the same trick ...
VB Code:
Private Sub Form_Load()
On Error GoTo NotInstalled
Dim XLAPP As Excel.Application
Set XLAPP = New Excel.Application
On Error GoTo ErrHandler
'Excel work here
Set XLAPP = Nothing
NotInstalled:
MsgBox "EXCEL Not Installed!"
ErrHandler:
MsgBox "Other Error Occurred!"
End Sub
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
Thanks again, but in the same vein I checked on one of my colleagues' PCs and found the same registry entry for Excel as I found for my own.
I think that the version part is supposed to be there...
But, is it possible to look into the system in the same way that the Windows Control Panel program does, and find an entry for Microsoft Excel??? This could be another way to solve my problem.
I was just thinking about the "use an error handler if all else fails" approach, when you just posted it.
However, what about the Control Panel's way of looking into the system using technology similar to that used in the "Add/Remove Programs" option? Is this viable?
But, if it's good enough for you to use the error handler method (!), then it's good enough for me!!!
Which control pannel app are you referring to.
I just thought too, it'd be the office version rather than the windows version which'll determine the registry entry - ignore the above, sorry!
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
Ah, okay the add/remove programs option isn't really viable here. It'll only show an entry for MS Excel in the uninstall programs list if it's only excel which has been installed. If you have the office cd & put word & excel on together, only 1 item will show in the uninstall list for Ms Office.
I've thought of another way though, you can use the api to search for Excel.exe on the current pc. I'll see if I can write a sample of this for you!
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details