Board index » delphi » Problem using D5's Server Objects to Export Data To Excel

Problem using D5's Server Objects to Export Data To Excel

Hi Folks,

I've written some routine which exports data from our Database to an Excel
Workbook and saves the results to a new Excel File.  On my PC everything is
working fine, but when I try to run the application on any other PC ( which
also have Office 2000 like my PC ) I cannot start Excel.  I get the
following message :

EOleException : Old format or invalid type library

Since everything is working fine on my PC, I can't imagine what exactly is
going wrong.  I am using Delphi 5 and using the Server Components which are
supplied with Delphi.  On my form I dropped the following components :

    exclapp: TExcelApplication;
    exclwb: TExcelWorkbook;
    exclws: TExcelWorksheet;

And I am starting Excel using the following routine :

procedure TfrmExportVerbruiken.StartExcel(const ShowExcel: Boolean);
begin
  FLCID := GetUserDefaultLCID;
  ExclApp.Connect;
  exclApp.ScreenUpdating[ FLCID ] := False;
  ExclApp.Visible[ FLCID ] := ShowExcel;
  ExclApp.Caption := 'NOMECA - Export Bruto Verbruiken';
end;

On my PC this works perfectly ( even the routines which do the actual export
to excel work fine ), but on another PC the application halts right after
the ExclApp.Connect statement with the 'EOleException : Old format or
invalid type library' error.

Anybody got an idea how I can solve this problem ?

If you can help me, please also send your replies to my E-Mail adress :
Stefaan_Les...@peopleware.be

Thanks a lot in advance,

Stefaan

 

Re:Problem using D5's Server Objects to Export Data To Excel


If the non-working machine is Win9x, make sure you install the latest DCOM
for 9x installation (downloadable from MS website). Also, make sure the
versions of Office on your development machine is the same version as on the
deployment machine.

have fun
--
Binh Ly
http://www.techvanguards.com

Quote
"Stefaan Lesage" <Stefaan_Les...@Peopleware.be> wrote in message

news:39853197$1_1@dnews...
Quote
> Hi Folks,

> I've written some routine which exports data from our Database to an Excel
> Workbook and saves the results to a new Excel File.  On my PC everything
is
> working fine, but when I try to run the application on any other PC
 which
> also have Office 2000 like my PC ) I cannot start Excel.  I get the
> following message :

> EOleException : Old format or invalid type library

> Since everything is working fine on my PC, I can't imagine what exactly is
> going wrong.  I am using Delphi 5 and using the Server Components which
are
> supplied with Delphi.  On my form I dropped the following components :

>     exclapp: TExcelApplication;
>     exclwb: TExcelWorkbook;
>     exclws: TExcelWorksheet;

> And I am starting Excel using the following routine :

> procedure TfrmExportVerbruiken.StartExcel(const ShowExcel: Boolean);
> begin
>   FLCID := GetUserDefaultLCID;
>   ExclApp.Connect;
>   exclApp.ScreenUpdating[ FLCID ] := False;
>   ExclApp.Visible[ FLCID ] := ShowExcel;
>   ExclApp.Caption := 'NOMECA - Export Bruto Verbruiken';
> end;

> On my PC this works perfectly ( even the routines which do the actual
export
> to excel work fine ), but on another PC the application halts right after
> the ExclApp.Connect statement with the 'EOleException : Old format or
> invalid type library' error.

> Anybody got an idea how I can solve this problem ?

> If you can help me, please also send your replies to my E-Mail adress :
> Stefaan_Les...@peopleware.be

> Thanks a lot in advance,

> Stefaan

Re:Problem using D5's Server Objects to Export Data To Excel


<<Stefaan Lesage:
EOleException : Old format or invalid type library

Quote

This is usually a localization problem that goes away if
you use 0 instead of the GetUserDefaultLCID value.

--
Deborah Pate

Other Threads