I have the below function that always crashes on the highlighted line. I have the following libraries added....Help please.
Libraries:
Visual Basic For Applications
MS Access 14.0 Object Library
OLE Automation
MS Office 14.0 Access database engine Object Library
MS Excel 14.0 Object Library
MS Outlook 14.0 Object Library
Code:
Function IsExcelRunning() As Boolean
Dim xlApp As Excel.Application
'On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
IsExcelRunning = (Err.Number = 0)
Set xlApp = Nothing
Err.Clear
End Function