Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending an array to a COM Property
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00748206
Message ID:
00748216
Vues:
17
You cannot assign VFP array to a COM object property. The COMARRAY() function has efect only on arrays passed as parameters to a COM object methods.

>I am tring the following code with excel, it should open a spreadsheet with 2 rows "1" and "2" but the 2 rows it creates are "1", it looks like VFP is only sending the first item of the array.
>
>How do should i send the array to the property Value so all items are sent?
>
>Thanks.
>
>LOCAL xlApp As Excel.Application
>
>DIMENSION x(2)
>
>x(1) = "1"
>x(2) = "2"
>
>xlApp = CreateObject("Excel.Application")
>xlWb = xlApp.Workbooks.Add
>xlWs = xlWb.Worksheets("Sheet1")
>xlApp.Visible = .T.
>xlApp.UserControl = .T.
>
>=COMARRAY(xlApp, 1)
>=COMARRAY(xlWs, 1)
>
>xlWs.Cells(2, 1).Resize(2, 1).Value = x
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform