Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i run excel embedded in my app
Message
De
18/10/2001 19:21:46
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00570560
Message ID:
00570579
Vues:
17
This message has been marked as the solution to the initial question of the thread.
>i am creating some SQL outputs to the excel (i am creating excel file and after i am running excel with created file) at this point i want to now how can i run excel embedded in my app like any form..
>(i saw a program written by delphi its doing)
>
>Thanks,

This example is form the VFP docs:
*frmMyForm = CREATEOBJECT('form')  && Create a form
*frmMyForm.Closable = .F.  && Disable the Control menu box

frmMyForm.AddObject('cmdCommand1','cmdMyCmdBtn')  && Add Command button
frmMyForm.AddObject("oleObject","oleExcelObject")  && Add OLE object

frmMyForm.cmdCommand1.Visible=.T.  && Display the "Quit" Command button

frmMyForm.oleObject.Visible=.T.  && Display the OLE control
frmMyForm.oleObject.Height = 50  && OLE control height

frmMyForm.Show  && Display the form

frmMyForm.oleObject.DoVerb(-1)  && -1 for Edit

READ EVENTS  && Start event processing

DEFINE CLASS oleExcelObject as OLEControl
   OleClass ="Excel.Sheet"  && Server name
   DocumentFile = "C:\EXCEL\BOOK1.XLS"  && This file must exist 
ENDDEFINE

DEFINE CLASS cmdMyCmdBtn AS CommandButton  && Create Command button
   Caption = '\<Quit'  && Caption on the Command button
   Cancel = .T.  && Default Cancel Command button (Esc)
   Left = 125  && Command button column
   Top = 210  && Command button row
   Height = 25  && Command button height

   PROCEDURE Click
      CLEAR EVENTS  && Stop event processing, close form
ENDDEFINE
HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform