mkasson
Programmer
- Jan 3, 2004
- 36
There is plenty of documentation on opening another application. My instance in Access VBA looks like the following:
The problem that I have is not so much with the code (I took it from a previous project). The problem is that despite the On Error, I am still getting an error box telling me of the 429 error "ActiveX component can't create Object" (the GetObject is failing because the Excel is not running).
Why is my On Error being ignored?
- MSK
Code:
Dim oApp As Object
...
On Error Resume Next ' Defer error trapping.
Set oApp = GetObject(, "Excel.Application")
If Err.Number = 429 Then
ExcelWasNotRunning = True
Err.Clear
Set oApp = CreateObject("Excel.Application")
End If
The problem that I have is not so much with the code (I took it from a previous project). The problem is that despite the On Error, I am still getting an error box telling me of the 429 error "ActiveX component can't create Object" (the GetObject is failing because the Excel is not running).
Why is my On Error being ignored?
- MSK