Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending an array to a COM Property
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00748206
Message ID:
00748216
Views:
16
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform