Custom Search

Friday, November 28, 2008

Determine if Excel is installed

Private Function IsExcelInstalled() As Boolean

On Error GoTo Hell

'Attempt to connect to word
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Sheet")

'Must have been successful
IsExcelInstalled = True

Exit_For:
Set objExcel = Nothing
On Error GoTo 0
Exit Function

Hell:
GoTo Exit_For

End Function

No comments: