Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Populating column headers
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Excel Populating column headers
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01267122
Message ID:
01267122
Vues:
57
I have a query that the number of fields returned is variable, so I've decided to make the printed version in Excel to handle variable number of columns (and their names). I have an array of the field names, so I was hoping I could just loop through them and set the values in the excel columns, problem is I'm not doing it right
oExcel=CREATEOBJECT("Excel.Application")
oExcel.visible=.t.
oWorkbook=oExcel.Workbooks.add()
oSheet=oWorkbook.worksheets[1]
oSheet.Range("A1").value=ALLTRIM(thisform.cbo_userdept1.DisplayValue)+[ - Patient Check List]
oSheet.Range("A2").value=[CQI Solutions, Inc.]
lnFields=AFIELDS(laFields2)
lnRow=4

FOR x= 1 TO lnFields
	oSheet.Range.cells(lnRow,x).value=laFields2[x,1]
ENDFOR 
The single line inside the loop bombs with an OLE invalid number of parameters message.

Thanks for any help.

Kirk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform