I'm acquiring data in from the comm port and storing it in an array. I followed MS's example on "Using automation to transfer an array of data to a range on a worksheet" There example works but when I try to put it in my code is doesn't. This is what I have:
Everything works except:Code:Set objBook = objExcel.Workbooks.Add objExcel.Cells(1, 1) = "Force" objExcel.Cells(2, 1) = "(" & lblUnits.Caption & ")" objExcel.Cells(1, 3) = Date objExcel.Range("C:C").ColumnWidth = 9.5 For i = 2 To Index Step 3 Format(j) = Mid$(DataArray(i), 4) j = j + 1 Next i objExcel.Cells(1, 6) = j objExcel.Range("C4", "C10").Value = "Hello" objExcel.Range("B4").Resize(100).Value = Format objExcel.Cells(1, 5) = Format(2)
If I change that line to say, Format(6) for example, then it prints that array value in 100 cells. It doesn't seem to want to print the entire array. What's wrong? I've tried putting parenths at the end and some other things with no luck. It will only "print" a single value multiple times, never multiple values one time, or something like that!Code:objExcel.Range("B4").Resize(100).Value = Format




Reply With Quote