Board index » delphi » Delphi 3 & Excel (DDE or OLE)

Delphi 3 & Excel (DDE or OLE)

Hi there,

I'm need to modify some specific cells value from an Excel file, what can I do ?
I'm using Excel 2000 and Delphi 3.

I've already tried DDE but can not connect, also tried to use OLE but don't know how to modify cells value.

Thanks for help.

Tony.

 

Re:Delphi 3 & Excel (DDE or OLE)


<<Tony:
I'm need to modify some specific cells value from an Excel
file, what can I do ?

Quote

If you have a worksheet object, WS, you can set a cell's
value like this:
  WS.Range['A1', 'A1'].Value := 0;

More examples at:
http://www.djpate.freeserve.co.uk/Automation.htm

--
Deborah Pate (TeamB) http://delphi-jedi.org

  Use Borland servers; TeamB don't see posts via ISPs
  http://www.borland.com/newsgroups/genl_faqs.html

Re:Delphi 3 & Excel (DDE or OLE)


Hi Deborah,

Can I do that even if I'm working with D3 which doesn't have any Excel Application component ?
And does it work with Excel 2000 ?

Thanks.

"Deborah Pate (TeamB)" <d.p...@cableinet.co.not-this-bit.uk> wrote:

Quote
><<Tony:>I'm need to modify some specific cells value from an Excel
>file, what can I do ?

>If you have a worksheet object, WS, you can set a cell's
>value like this:
>  WS.Range['A1', 'A1'].Value := 0;

>More examples at:
>http://www.djpate.freeserve.co.uk/Automation.htm

>--
>Deborah Pate (TeamB) http://delphi-jedi.org

>  Use Borland servers; TeamB don't see posts via ISPs
>  http://www.borland.com/newsgroups/genl_faqs.html

Re:Delphi 3 & Excel (DDE or OLE)


<<Tony:
Can I do that even if I'm working with D3 which doesn't
have any Excel Application component ?
And does it work with Excel 2000 ?
Quote

Yes and yes. You import the type library, using the
Project|Import type library menu, and use the interfaces
declared in the file that is generated for you
(Excel_TLB.pas, located in the Delphi\Imports directory).
There is information about getting started using interfaces
at
http://www.djpate.freeserve.co.uk/Automation.htm

--
Deborah Pate (TeamB) http://delphi-jedi.org

  Use Borland servers; TeamB don't see posts via ISPs
  http://www.borland.com/newsgroups/genl_faqs.html

Re:Delphi 3 & Excel (DDE or OLE)


Hi,

I see the point.

Well, I tried to Project|Import type library Excel9.olb (I couldn't find Excel8.olb), it was ok. Then I removed the unit from my project and put the Excel_TLB in the USES clause but I got an error while compiling at this line :

procedure Change(const Ctrl: CommandBarComboBox); stdcall;

The error was "Undeclared identifier: 'CommandBarComboBox'"

Do you know what is wrong ?

Thanks.

Tony.
"Deborah Pate (TeamB)" <d.p...@cableinet.co.not-this-bit.uk> wrote:

Quote
><<Tony:
>Can I do that even if I'm working with D3 which doesn't
>have any Excel Application component ?
>And does it work with Excel 2000 ?

>Yes and yes. You import the type library, using the
>Project|Import type library menu, and use the interfaces
>declared in the file that is generated for you
>(Excel_TLB.pas, located in the Delphi\Imports directory).
>There is information about getting started using interfaces
>at
>http://www.djpate.freeserve.co.uk/Automation.htm

>--
>Deborah Pate (TeamB) http://delphi-jedi.org

>  Use Borland servers; TeamB don't see posts via ISPs
>  http://www.borland.com/newsgroups/genl_faqs.html

Other Threads