Board index » delphi » Delphi 2.01,Excel7.0a, OLE Error Method Workbooks not supported by OLE Object

Delphi 2.01,Excel7.0a, OLE Error Method Workbooks not supported by OLE Object

Hello all,

urgent - I'm having trouble with Delphi 2.01 and Excel 7.0a (Office 95)
OLE automation. I' ve tested the following sample and after pressing
Button1 (IDE running) the only response i get is an error message saying
something like EOLEerror, Method 'Workbooks is not supported by the OLE
Object. MS Office 95 is installed, the Excel version is 7.0a. I've
tested this sample on three different machines using WIN95/A , WIN95/B
and Office 95 , but the result is allways the same.

Has someone an idea what's wrong here ??

So long,

Hartmut

Here is the sample source:
-------------------------------

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

uses
  OleAuto;

var
  vExcel: variant;

procedure TForm1.Button1Click(Sender: TObject);
begin
  vExcel := CreateOleObject('Excel.Application');
  vExcel.Workbooks.Add;
  vExcel.ActiveWorkbook.Worksheets(1).Range('A1').Value := 'Hello
World';
  vExcel.Visible := True;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  if not VarIsEmpty(vExcel) then vExcel.Quit;
end;

end.

 

Re:Delphi 2.01,Excel7.0a, OLE Error Method Workbooks not supported by OLE Object


: Hartmut Hoffmann <hhoffm...@aol.com> wrote:

Quote
>urgent - I'm having trouble with Delphi 2.01 and Excel 7.0a (Office 95)
>OLE automation.

From your name I take it that you might be based in Germany or in a
German-speaking country.

It is custom for software to run in the local language setting - and
Excel does so, even for late-bound OLE automation.

IOW, try talking to Excel in German - replace "Workbooks" with
whatever is the correct GERMAN VBA name.

--
Stefan Hoffmeister       http://www.econos.de/
No private email, please, unless expressly invited.

Re:Delphi 2.01,Excel7.0a, OLE Error Method Workbooks not supported by OLE Object


Hallo Stefan,

DANKE fr den Tip. Habe die bersetzung der VBA Schlsselw?rter in
VBALISTE.XLS im Excel Verzeichnis gefunden und ausprobiert -> funktioniert
gut !

Hartmut Hoffmann

--

Stefan Hoffmeister schrieb:

Quote
> : Hartmut Hoffmann <hhoffm...@aol.com> wrote:

> >urgent - I'm having trouble with Delphi 2.01 and Excel 7.0a (Office 95)
> >OLE automation.

> From your name I take it that you might be based in Germany or in a
> German-speaking country.

> It is custom for software to run in the local language setting - and
> Excel does so, even for late-bound OLE automation.

> IOW, try talking to Excel in German - replace "Workbooks" with
> whatever is the correct GERMAN VBA name.

> --
> Stefan Hoffmeister       http://www.econos.de/
> No private email, please, unless expressly invited.

Re:Delphi 2.01,Excel7.0a, OLE Error Method Workbooks not supported by OLE Object


Hi Hartmut,

Pay attention, if now it work with Excel 7, it will not work with Excel 8
cause Excel 8 run in english language even if you have a german version !

Thanks MS !

Hartmut Hoffmann <hhoffm...@aol.com> a crit dans l'article
<3661B57E.77D2A...@aol.com>...

Quote
> Hallo Stefan,

> DANKE fr den Tip. Habe die bersetzung der VBA Schlsselw?rter in
> VBALISTE.XLS im Excel Verzeichnis gefunden und ausprobiert ->
funktioniert
> gut !

> Hartmut Hoffmann

Other Threads