Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ExcelApp.ConnectTo error -2147352565

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi

I've written some very simple Excel automation stuff which runs fine on most machines but on 2 machines I get the message

"Error -2147352565 has occurred"

which isn't very intuitive. The machines are running the exact same version of Excel. The error occurs on the ConnectTo call, the Connect call is OK.

The code, ExcelApp(TExcelApplication comp) and ExcelSheet (TExcelWorksheet comp) :

ExcelApp.connect;
ExcelSheet.ConnectTo(ExcelApp.Worksheets.Item['control'] as _Worksheet);


Anyone got any ideas why I'm getting this error?

Thanks in advance
lou
 
in fact if you convert this error to hex you'll get
0x08002000B.
Googling this error seems to indicate that the eror is DISP_E_BADINDEX and this means that the worksheet does not exist.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Thanks for the reply, Daddy, you are right but it can also refer to a path missing in the windows registry.

We ran a repair via Add/Remove programs, on MS Office. This fixed the problem!

Thanks again,
Lou
 
glad you sorted it out!

[cheers]
/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top