Delphi Tokyo, Office 2016. I have an existing app, been running great for a while. I went this morning to run the application, and all the sudden it is throwing an error. I open the source code and step through it. It is throwing the following error:
'Project ... raised exception class EIntfCastError with message 'Interface not supported'.
The line of code causing the issue is
oExcel := CreateOleObject('Excel.Application') as ExcelApplication;
The source code has not changed. The issue was first found in the executable. Excel appears to be working fine. There is one other fact, which may or may not be relevant... Every time I start Outlook I get a popup Error message 'Failed to load the elevation application'. This started approximately 1 month ago, and to my knowledge, I don't believe I have run my application since I started receiving this message. I cannot find any information about this, but it does not seem to effect Outlook. (I have performed both a Quick Repair as well as an Online Repair for MS Office 2016, but neither effort changes anything.) When I look at Outlook Plugins, I do NOT have any plugIn called 'Elevation'.
The Outlook issue may or may not be related to the Excel issue.
What is going on here? How do I debug this further?
oExcel := CreateOleObject('Excel.Application') as ExcelApplication
into two, i.e. doing theCreateOleObject
andas ExcelApplication
into two separate statements, so you can see which one is causing the exception? It is most likely the second, but better to be sure. – MartynAoExcel := IDispatch(oExcel) as ExcelApplication
– MartynA