Board index » delphi » D4 How to run procedure on Excel 97 Visual Basic?

D4 How to run procedure on Excel 97 Visual Basic?

How to run procedure on Excel 97 Visual Basic?
I have Excel 97 document with
procedure on VB: zet(m)
And I have Delphi 4.
-
I want to run my VB procedure
when I filled the Excel worksheet.
-
I make:
  XLApp := CreateOleObject('Excel.Application');
  XLApp.Workbooks.Add(Template:='C:\NaklNarrow.xlt');
  XLApp.Visible := True;
  XLApp.Application.Goto(Reference:='Naim');
  XLApp.ActiveCell.FormulaR1C1 :='text';

  XLApp.Call.Zet(4); // - don't work!

--
Thanks...
klo...@tv-park.kiev.ua; (+38 044) 464-71-85, 464-71-78 - work
klo...@maile{*word*277}.com; http://klokov.conk.com - home

 

Re:D4 How to run procedure on Excel 97 Visual Basic?


Quote
 Sergiy Klokov wrote:
>   XLApp.Call.Zet(4); // - don't work!

Try the method RUN(MacroName:='');
The problem is: you can't use parameters when using RUN. But I found
sth. that sounds pretty good on this[1] website.

Try this: XLApp.Run('Zet', '4');

[1] http://vzone.{*word*269}.net/graham.marshall/excel.htm
    (url just sounds strange, but is serious ;)

Bye, Udo

Other Threads