I am writing a function to export data from a gridview to Excel this method on VB .NET:
Call consultaPlanilha()
Dim i, j As Integer 'CONTADORES
ReDim vetPontos(GridPontos.Rows.Count - 2, 1)
For i = 0 To GridPontos.Rows.Count - 2
For j = 0 To 1
vetPontos(i, j) = CDbl(GridPontos.Item(j, i).Value)
xlw.Application.Cells(i + 3, j + 2).Value = vetPontos(i, j)
Next
Next
xlw.Save()
This is taking a long time for large amounts of data. Is there a faster way to write a lot of data to Excel at once? Would doing something with ranges be faster?
You know you can do this: