Error "The object invoked has disconnected from its clients." when setting RowHeight using Excel OLE Automation
Posted on 2005-03-24
I have a VB 6.0 project that contains code to generate an Excel report. The report has been working well for a long time; however, I am now getting the following error:
The object invoked has disconnected from its clients.
err.number = -2147417848
The line kicking the error reads:
oSheet.Rows("3:3").RowHeight = 77.25
Where oSheet is declared as follows:
Set oXL = CreateObject("Excel.Application")
Set oBook = oXL.Workbooks.Add()
Set oSheet = oBook.Sheets(1)
This is a showstopper. If anyone has any ideas I would be greatly appreciative.