Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1241
  • Last Modified:

CreateOLEObject in Delphi 8 for .NET

Hi, I´m trying to develop a program automating OLE Applications such as EXCEL or AUTOCAD

I´ve tried this code for EXCEL

       OleApplication :variant;
       OleWorkBook    :variant;

     procedure TForm1.FormCreate(Sender: TObject);
        OleApplication := CreateOleObject('Excel.Application');

But compiler reports this error :

[Error] Unit1.pas(104): Undeclared identifier: 'CreateOleObject'

When i try similar code for AutoCAD i gets an error in the same method.

What´s wrong ?
1 Solution
Mohammed NasmanSoftware DeveloperCommented:
CreateOleObject doesn't exist in Delphi 8, as this comment from one of Borland employees
From: Chris Bensen (nomail@borland.com)
Subject: Re: CreateOleObject!?!?
View this article only
Newsgroups: borland.public.delphi.com.interop.dotnet
Date: 2004-11-09 12:02:31 PST

Hi Richard,

CreateOleObject located in ComObj.pas has not been ported to
Borland.Vcl.ComObj.pas. You will need to either use CoCreateInstance or
generate an import assembly with tlbimp.exe or add a reference to the
type library and the IDe will generate the import assembly.


diordonezAuthor Commented:
OK, thanks  ! you´ve saved me a lot of time.

I´ve decided to downgrade to delphi 7, and it works well

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now