CreateOLEObject in Delphi 8 for .NET

Posted on 2004-11-11
Last Modified: 2007-12-19
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 ?
Question by:diordonez
    LVL 22

    Accepted Solution

    CreateOleObject doesn't exist in Delphi 8, as this comment from one of Borland employees
    From: Chris Bensen (
    Subject: Re: CreateOleObject!?!?
    View this article only
    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.



    Author Comment

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

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

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now