Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
PeterH
 
Posts: n/a
Default 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   Report Post  
Harlan Grove
 
Posts: n/a
Default

"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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
I get a program error when I download an excel template Ladybug Excel Discussion (Misc queries) 3 March 4th 05 12:02 AM
html to excel nellie Excel Discussion (Misc queries) 4 February 8th 05 10:37 PM
Merge from Excel to Excel dalstar Excel Discussion (Misc queries) 3 January 30th 05 02:37 PM
pivotcell object to excel 2000 Kellyc Excel Discussion (Misc queries) 0 December 1st 04 03:45 PM


All times are GMT +1. The time now is 03:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"