Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wouldn't the safest method of checking for excel is to really check to see if
it's there. Both of these worked ok for me in MSWord--I'm not sure what language you're using. 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 'not installed Else myXL.Quit End If Set myXL = Nothing End Sub Sub testme2() Dim myXL As Object Dim isInstalled As Boolean Set myXL = Nothing On Error Resume Next Set myXL = CreateObject("excel.application") isInstalled = CBool(Err.Number = 0) On Error GoTo 0 If isInstalled Then myXL.Quit Else 'not installed End If Set myXL = Nothing End Sub Mark wrote: Hi, My program needs to check if excel is installed before continuing so that way it doesn't fail if it can't use the Excel.Application object. Does anyone know a relaible way to check for this among all versions of Excel? I can't seem to find a steady registry key or file location that I know will always be there for any version. Thanks. Mark -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking for the existence of a worksheet | Excel Discussion (Misc queries) | |||
Checking for the existence of a characted in a string | Excel Discussion (Misc queries) | |||
Checking for existence of excel | Excel Programming | |||
Checking for the Existence of a Folder | Excel Programming | |||
Checking for existence of macros or code in an Excel Spreadsheet | Excel Programming |