I have a legacy application (Delphi 5) that allows the user to export data to excel. To the best of my knowledge, this application worked for ALL users prior to Office 2013. We have recently begun rolling out Office 365/2013 - after getting O365 some users are no longer able to export the data to Excel. As near as we can tell, for these users NOTHING happens (Excel doesn't get focus, no new worksheets / tabs are added to existing instances, Excel doesn't start if it isn't running). Other users who have gotten O365 seem to have no trouble with the application.
A couple months ago, we had a user experience this problem after receiving Office 2013 (non O365). Before any coding / significant research occurred, the user was given a different hard drive (I think it was her previous hard drive, but am not 100% sure) and, voila, everything worked for her. This leads me to believe it may be a registry setting or some other configuration issue.
Is anyone aware of any registry settings / application configuration settings that could cause / resolve this, do we have to re-write the logic to export the data, or is there something else that I'm not thinking of?
For reference, here is the code snippet that performs the export to Excel (I added the 'ExcelApplication1.Connect;' as shown here http://www.djpate.freeserve.co.uk/AutoExcl.htm#StartingExcel - however, that did not resolve the issue):
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls,// excel_tlb,
Forms, Dialogs, checklst, Buttons, ToolWin, ComCtrls, Menus, Grids, DBGrids,
ExtCtrls, Db, DBTables, DBClient, About, Report, IniFiles, Cdberr32,
Ulogin32, ComObj, olectnrs, Find, ImgList, excel97, OleServer, clipbrd,
AppEvnts;
. . .
procedure TfrmMain.btnExportClick(Sender: TObject);
var
RangeE :Excel97.range ;
I, Row : integer ;
myClip : TClipBoard ;
Arr : variant ;
j : integer ;
begin
//Replacing zoli code with OLE server code GM
//Create and show Excel spread sheet
if qrylocations.RecordCount = 0 then
Exit;
try
//Replace the after scroll procedure slows down process.
qrylocations.AfterScroll := DummyMethod ;
//Open Excel App and create new worksheet
ExcelApplication1.Connect;
ExcelApplication1.Visible[0] := True ;
ExcelApplication1.Workbooks.Add(Null, 0) ;
Arr := VarArrayCreate([1,qryLocations.Recordcount,1,3],varvariant) ;
//Set teh data to the variant array
with qryLocations do
begin
First;
DisableControls ;
for i := 0 to recordcount -1 do
begin
Arr[i+1,1] := Fields[0].ASstring ;
Arr[i+1,2] := Fields[2].ASstring ;
Arr[i+1,3] := Fields[5].ASstring ;
Next ;
end ;
end ;
//Set the excel worksheet to the variant array
ExcelApplication1.Range['A1', 'C' + IntToStr(qrylocations.recordcount)].value := Arr ;
finally
qryLocations.EnableControls;
//Reset the after scroll method back to original state
qrylocations.AfterScroll := qryLocationsAfterScroll ;
end ;
end;
The properties for ExcelApplication1 are as follows:
- AutoConnect = false
- AutoQuit = false
- ConnectKind = ckRunningOrNew
- Name = ExcelApplication1
- RemoteMachineName = [EMPTY]
- Tag = 0