Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How to determine programatically if Excel is installed
Can anybody tell me what is the best way to determine programatically from
VBA or VB6 whether Excel is installed on the current machine and, if so, what version. -- Peter |
#2
|
|||
|
|||
"PeterH" wrote...
Can anybody tell me what is the best way to determine programatically from VBA or VB6 whether Excel is installed on the current machine and, if so, what version. There's always Registry scanning. Search for the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Then within this key search for the highest subkey of the form 8.0, 9.0, 10.0, 11.0 (nothing past 11.0 yet) containing an Excel\InstallRoot subkey. That'd be the newest version installed. There should also be API function calls to read version tags from .EXE or ..DLL files. You could use them to read the version tag from the Excel executable, EXCEL.EXE. |
#3
|
|||
|
|||
I don't use VB6, but this worked from MSWord.
Option Explicit Sub testme() Dim myXL As Object Set myXL = Nothing On Error Resume Next Set myXL = CreateObject("Excel.Application") On Error GoTo 0 If myXL Is Nothing Then MsgBox "not installed" Else MsgBox "Yep, they have it" & vbLf & myXL.Version myXL.Quit Set myXL = Nothing End If End Sub PeterH wrote: Can anybody tell me what is the best way to determine programatically from VBA or VB6 whether Excel is installed on the current machine and, if so, what version. -- Peter -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
I get a program error when I download an excel template | Excel Discussion (Misc queries) | |||
html to excel | Excel Discussion (Misc queries) | |||
Merge from Excel to Excel | Excel Discussion (Misc queries) | |||
pivotcell object to excel 2000 | Excel Discussion (Misc queries) |