Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28632 Discussions

Autosetproperty issue when dealing with excel

henrylou
Beginner
340 Views
Please excuse my poor english first.
I try to set values of a column in Excel sheet using a single dimension array, but failed.
All the fields of that column will appear to be same as the first entry of that array. Certainly I can set value of the column by one cell a time, but it is not convinient.
If I operate on row, there is no problem.
Code:
   CALL VariantInit(vBSTR)
   vBSTR%VT = VT_BSTR
   bstr = ConvertStringToBSTR("A1:A10")
   vBSTR%VU%PTR_VAL = bstr
   range = $Worksheet_GetRange(worksheet, vBSTR, $STATUS =status)
   CALL Check_Status(status, " Unable to get RANGE object")
   status = VariantClear(vBSTR)
   status = AUTOSETPROPERTY (range, "VALUE", A)
Anybody knows how to deal with that except usingf90vb?
0 Kudos
1 Reply
ipattielgc
Beginner
340 Views
I believe this is a known bug, I've seen other references to it, and found the same problem. I just bit the bullet and once I have the range object, get the row and col counts, and step through the cells one by one. Not elegant, but the same code lets you deal with 2d arrays in any order as well.
Ian
0 Kudos
Reply