Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invoking Excel Macro From Within Foxpro
Message
De
31/08/1999 18:12:45
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00259829
Message ID:
00259949
Vues:
11
Hi Jeff --- Try

=ObjExcel.Run("personal.xls!macro1")

>I need to invoke a Excel macro, stored in personal.xls, within the workbook/sheet ast1.xls. The code now is:
>
>*=====
>* Create a reference to Excel
>objExcel = CreateObject("Excel.Application")
>
>* Open personal workbook
>cFileName = "w:\work\output\personal.xls"
>objBook = objExcel.WorkBooks.Open(cFileName)
>
>* Open ast1 workbook
>cFileName = "w:\work\output\ast1.xls"
>objBook = objExcel.WorkBooks.Open(cFileName)
>
>* Make Excel visible so you can see the show
>objExcel.Visible = .T.
>
>*INVOKE THE MACRO
>application.run "personal.xls!macro1"
>*=====
>
>Everything opens fine, but the macro is not invoked.
>Any ideas that would make this work?
>
>Thanks.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform