Excel dna range

Jul 25, 2014 at 8:42 AM
I have read some tutorial range array/array resizer but quite not understand about it..
It is possible to set a range and fill it with array ?

dynamic ws = app.ActiveSheet;
var r = ws.Range["A1:H1"];
string[,] workingValues = new string[8, 8];
foreach (var row in results.data) {
workingValues[vertical,horizontal] = row.transactionDate;
workingValues[vertical,horizontal] =row.category;
}
r.Value2 = app.Transpose(workingValues);
When i try it only work like ws.Range["A1","A4"] not like ws.Range["A1:H1"]
Jul 27, 2014 at 8:09 AM
Edited Jul 27, 2014 at 8:14 AM
                dynamic app = ExcelDnaUtil.Application;
                app.ScreenUpdating = false;
                app.EnableEvents = false;
                dynamic ws = app.ActiveSheet;
                object[] objHeaders = { "Counter", "Date", "Category","Account","Description","Debit","Credit","Amount" };
                var range = ws.Range("A1","H1");
                range.Value = objHeaders;
                
                range = ws.Range("A2", "H"+(results.totalRecord+2).ToString());
                object[,] transcriptsDump = new object[(results.totalRecord + 2),16];
                int d = 0;
                foreach (var row in results.data)
                {
                    transcriptsDump[d, 0] = (int) row.counter;
                    d++;
                }
                ///'Paste' the data from the table into the range specified
                range.Value2 = transcriptsDump;
                
                app.ScreenUpdating = true;
                app.EnableEvents = true;
Solve it.. got information from excel-dna google group
Previously i'm using
 for (int i = 0; i < 12; i++)
 {
   d= i+2;
    j++;
   ws.Range["A" + d.ToString()].Value = j;
   ws.Range["B" + d.ToString()].Value = results.data[i].ChartOfAccountDescription;
}
Seem to slow 20 second to load in excel
then i add below
app.ScreenUpdating = false;
app.EnableEvents = false;
After searching and googling found up in google group..yipii 1 second load excel data.
Marked as answer by alien3dx on 7/27/2014 at 1:10 AM