I can read an array into an excel range and vice versa in Excel VBA,
but I think I am missing something when I try to do the same thing in
VB.Net.

A relevant section of my VBA code looks like:

    Dim tempArray() As Variant
    Dim xlsRange As Range

    startRow = 7

    ReDim tempArray(1 To Total_Years, 1 To 2)
    Set xlsRange = Range(Cells(startRow, 2), Cells(startRow +
Total_Years - 1, 3))

    For y = 1 To Years
        tempArray(y, 1) = Output_Vars(y, 1)
        tempArray(y, 2) = Output_Vars(y, 2)
    Next y
    xlsRange = tempArray

Where Output_Vars, Years, Layers are passed to the subroutine.
Can someone please show me what this should look like in VB.Net?

Reply via email to