Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Export
Message
 
À
06/10/2000 08:01:46
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00425832
Message ID:
00425835
Vues:
21
>How can I open a new worksheet through Visual Fox Pro in EXCEL, put some values in some cells and automatically save the worksheet in a certain filename.xls


Petros,

Here's the basic commands to get you going:

* Open Excel and make it visible
oExcel = CreateObject("Excel.Application")
oExcel.Visible = .T.

* Add a workbook
oWorkbook = oExcel.Workbooks.Add()

* Grab a reference to the first worksheet
oSheet = oWorkbook.Sheets[1]

* Add some values
WITH oSheet
.Range("A1").Value = "A"
.Range("B1").Value = 1

* and so on...
ENDWITH

* Now save it
oWorkbook.SaveAs('c:\mypath\filename.XLS')

* Now clean up
oExcel.Quit
RELEASE oExcel, oWorkbook, oSheet

This should get you started.

- della Martin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform