Reputation: 3238
Delphi Rio, Win10 64 bit, Excel 2016-64 bit. I have a utility I wrote in Delphi a while back. It opens an html file, starts Excel, parses the html file, and dumps various parts into Excel. It has been working great... All of the sudden, I go to run it recently and I am now getting errors. Specifically I am getting EOleSysError - Server Execution failed, ProgID: Excel.Application. This occurs when trying to start Excel. I had not recompiled my program, it just stopped working and now gives this error. I verified that Excel can be manually started/used/stopped without issue. I verified that there are no Excel executables running in the background. I did try a full recompile on my app, no change... The only things on the system that have changed is that windows did a pretty big update, and I have installed a few additional programs (Logitech camera, etc. none that talk to Excel). I am at a loss. When I run through my code, it fails on the CreateOleObject line. Here is the routine..
// This routine Starts excel
function glib_StartExcel: Integer;
var
myAPP: OleVariant;
Save_Cursor: TCursor;
begin
// Assume that it is already running
result := glib_FAILURE;
if not Assigned(oExcel) then
begin
Save_Cursor := Screen.Cursor;
Screen.Cursor := crHourglass;
myAPP := CreateOleObject('Excel.Application');
oExcel := IDispatch(myAPP) as ExcelApplication;
Screen.Cursor := Save_Cursor;
result := glib_SUCCESS;
end;
end;
oExcel is a global variable of type ExcelApplication. Among others, my USES clause contains
System.UITypes, ComObj, Office_TLB, Excel_TLB, DB,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls,...
I went and checked a totally different program which again, starts and works with Excel. I receive a similar error: EOleSysError: Server Execution failed, ClassID:{bunch of number... appears to be a GUID}. This program has not been recompiled either. Any thoughts? Any idea what is going on?
** Additional Info. I get Error messages in the Windows Event Log when I try to run my program(s). The messages are:
Faulting application name: EXCEL.EXE, version: 16.0.11629.20246, time stamp: 0x5cfadf82
Faulting module name: KERNELBASE.dll, version: 10.0.19041.572, time stamp: 0x1183946c
Exception code: 0xc0020001
Fault offset: 0x0000000000023e49
Faulting process id: 0x208
Faulting application start time: 0x01d6b84ea1de50b0
Faulting application path: C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: bed97990-8ead-4593-a058-e834105f0654
Faulting package full name:
Faulting package-relative application ID:
** EDIT2 - I found a MS Word Macro which uses CreateObject... to open Excel. This will not work either in my Computer. This leads me to believe someone my computer config is messed up. I did go into Windows update and make sure I have all updates applied.
**EDIT3 - I did both a Office Quick Repair, as well as Online/Full Repair (which downloads and appears to re-install Office. Neither changes the issue.
Upvotes: 1
Views: 1522
Reputation: 1
Possible solution, had a similar problem, only with LibreOffice. Helped Component Services->Computers->My Computer->DCOM Config->LibreOffice Service Manager(Ver1.0)->Identity->Change from Starting User to Current User
Upvotes: 0
Reputation: 3238
Thanks everyone for your suggestions... unfortunately nothing worked, including full online repair. I finally had to completely uninstall and then re-install. That fixed my issue.
Upvotes: 1