G
Guest
Hello All--
Before I get to my problem, let me acknowledge that I understand what we are
doing is not supported by Microsoft (KB257757). This thread is not intended
to be a discussion on whether Microsoft should support a part of their
product that is available for use.
Anyhoo...
We have an application that uses Excel Automation to run scheduled reports
(that use an Excel Add-In). In order for the application to use the Add-In,
it must open it during initialization. We do so as follows (simplified):
The problem occurs when we try to open the Add-In - it hangs there, with no
error thrown. We know that it hangs on this line because we have put debug
code in to put something in a file before and after it.
We put some code into the Workbook_Open event of the Add-In that would put
debug messages into a file, and also tried putting a Sleep in there.
Sometimes we see the debug file, sometimes not. Sometimes it does hang when
we try to open the Add-In, sometimes it does not. It is not consistent from
machine to machine, or even on the same machine, making it seem like a timing
issue.
When running this code, we do hear a "beep," likely meaning that an
invisible error or warning dialog is up, and cannot be acknowledged. If we
could even see or find out what this dialog was, it may give us a clue to a
fix.
Thanks,
pagates
Before I get to my problem, let me acknowledge that I understand what we are
doing is not supported by Microsoft (KB257757). This thread is not intended
to be a discussion on whether Microsoft should support a part of their
product that is available for use.
Anyhoo...
We have an application that uses Excel Automation to run scheduled reports
(that use an Excel Add-In). In order for the application to use the Add-In,
it must open it during initialization. We do so as follows (simplified):
Code:
Dim ExcelAPP As Object
Dim tempAddin As Object
Set ExcelAPP = CreateObject("Excel.Application")
ExcelAPP.DisplayAlerts = False
ExcelAPP.AlertBeforeOverwriting = False
On Error Resume Next
For Each tempAddin In ExcelAPP.AddIns
If tempAddin.Installed Then
ExcelAPP.Workbooks.Open (tempAddin.FullName)
End If
Next
The problem occurs when we try to open the Add-In - it hangs there, with no
error thrown. We know that it hangs on this line because we have put debug
code in to put something in a file before and after it.
We put some code into the Workbook_Open event of the Add-In that would put
debug messages into a file, and also tried putting a Sleep in there.
Sometimes we see the debug file, sometimes not. Sometimes it does hang when
we try to open the Add-In, sometimes it does not. It is not consistent from
machine to machine, or even on the same machine, making it seem like a timing
issue.
When running this code, we do hear a "beep," likely meaning that an
invisible error or warning dialog is up, and cannot be acknowledged. If we
could even see or find out what this dialog was, it may give us a clue to a
fix.
Thanks,
pagates