When I run the following code, I get an exception below:
''
Dim ReportBooks As Excel.Workbooks = ExcelApp.Workbooks
Dim ReportBook As Excel.Workbook = ReportBooks.Open(localFilename)
Dim ReportSheet As Excel.Worksheet = ReportBook.Sheets("Report")
''
ReleaseCOM(ReportSheet)
ReportBook.Close(True) ''
ReleaseCOM(ReportBook)
ReleaseCOM(ReportBooks)
ERROR:
COMException was unhandled
The object invoked has disconnected from its clients.
(Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
Note. All data appears to have been returned correctly.
Please help me diagnose and overcome this error.
source
share