Board index » delphi » Running Excel VBA macro from Delphi ...
Greg_Del_Pilar
![]() Delphi Developer |
Mon, 21 Nov 2005 04:48:03 GMT
|
Greg_Del_Pilar
![]() Delphi Developer |
Mon, 21 Nov 2005 04:48:03 GMT
Running Excel VBA macro from Delphi ...
Hi!
I have written a VBA macro that automates some tasks in my Excel worksheet I know that I can write routines in Delphi that can simulate some of the Thanks for your help. Greg |
Maynard Philbroo
![]() Delphi Developer |
Mon, 21 Nov 2005 12:48:42 GMT
Re:Running Excel VBA macro from Delphi ...you have a couple of options. use the MyVariant := CreateOLEObject('Excel.Document'); MyVariant.Open('filename x....'); -- secondly if you look a the server tabs you will find one for the Excel. QuoteGreg_Del_Pilar wrote: |
Nicholas Sherloc
![]() Delphi Developer |
Mon, 21 Nov 2005 16:20:24 GMT
Re:Running Excel VBA macro from Delphi ...Quote"Greg_Del_Pilar" <Greg_Del_Pi...@hotmail.com> wrote in message Quote> Hi! Cheers, |
Greg_Del_Pila
![]() Delphi Developer |
Tue, 22 Nov 2005 00:34:06 GMT
Re:Running Excel VBA macro from Delphi ...Nicholas: Thanks! I have definitely considered trying to use VB6 to accomplish what Greg Quote"Nicholas Sherlock" <n_sherl...@hotmail.com> wrote in message Quote> "Greg_Del_Pilar" <Greg_Del_Pi...@hotmail.com> wrote in message |
David Pierso
![]() Delphi Developer |
Tue, 22 Nov 2005 20:03:07 GMT
Re:Running Excel VBA macro from Delphi ...// static FvExcel : OLEVariant; // can be temporary vWorkbook : OLEVariant; // Kill existing instance if not first time & user hasn't killed it (you may // Run the code that is in the macro "DoSomething", which is held in the vWorkbook := FvExcel.Workbooks.Open( ExtractFilePath(Application.ExeName) It took longer than I care to remember to get this sorted out ... Regards Quote"Greg_Del_Pilar" <Greg_Del_Pi...@hotmail.com> wrote in message Quote> Nicholas: |
Greg_Del_Pila
![]() Delphi Developer |
Wed, 23 Nov 2005 04:46:38 GMT
Re:Running Excel VBA macro from Delphi ...David: THANK YOU, THANK YOU, THANK YOU! Greg Quote"David Pierson" <eshar...@yahoo.com> wrote in message Quote> // static - Hide quoted text - - Show quoted text - Quote> + '..\XL\MyMacro.xls'); |