Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel cell value update automation?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01048762
Message ID:
01048871
Vues:
16
Peter,

I took it from the www.foxclub.ru forum sometimes ago, but I still explore this approach and use it with care: you know,
- array size limitation in versions prior to VFP9;
- Excel row count limit;
- PC memory size, etc...


>Hi Yuri,
>THAT'S NEAT. I did not know we can use arrays like that
>
>I also played with the reverse
>
>
>la1=oExcel.Range("A1:B1245").Value
>
>
>returns the values into an Array named la1
>
>great!
>
>Thanks
>
>Peter
>
>>Edgar
>>
>>If I understand you correctly, you wish to populate the excel sheet from the foxpro array. Then you may use something like this (here is an example to work with character, numeric, and date types):
>>
>>
>>PROCEDURE yArray2Excel
>>Dimension Array2Excel(2,4)
>>
>>FOR ia=1 TO ALEN(Array2Excel)
>>	Array2Excel[ia]= IIF(ia%3=0, DTOC(DATE()),;
>>				IIF(ia%2=0,['], "")+TRANSFORM(ia))
>>ENDFOR
>>
>>Array2Excel[1,1]="Hello"
>>Array2Excel[2,1]=DATETIME()
>>
>>oExcel=Createobject("EXCEL.APPlication")
>>oExcel.Visible=.T.
>>oExcel.Workbooks.Add()
>>oExcel.Range("A1:D2").Value = PassArray("Array2Excel")
>>
>>oExcel=null
>>
>>RETURN
>>*--------------------------------------------
>>Procedure PassArray
>>Lparameters lcArrayName
>>Return @&lcArrayName    && for VFP7 and above
>>*-----------------------------------------
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform