ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel cell by cell writing. (https://www.excelbanter.com/excel-programming/417954-excel-cell-cell-writing.html)

gutta

Excel cell by cell writing.
 
int ePointer = ir.GetEntryPointer();
Xl.Worksheet sheet =
(Xl.Worksheet)DotNetInsFunctions.xlApp.Worksheets[ir.GetInfo().Sheet];
while(ePointer = 0)
{
Entry e = ir.GetEntry(ePointer);
Xl.Range cell =
(Xl.Range)sheet.Cells[e.row,e.column];
cell.Value2 = e.initValue;
ePointer = ir.GetEntryPointer();
}


In the above code, if the while loop executes for 10,000 cells, it
takes 300sec to write values to 10,000 cells. If I want to do a cell
by cell writing, this is how slow it is performing..
Does anyone know of any other effective and fast way of writing stuff
to sheet in a cell by cell manner.

ShaneDevenshire

Excel cell by cell writing.
 
Hi,

where is the data comming from?

Normally we would
For each cell in Range("A1:A10000")
cell = x
Next cell

but there are lots of ways to speed this up depending on where the data is
and where you want to put it.
--
Thanks,
Shane Devenshire


"gutta" wrote:

int ePointer = ir.GetEntryPointer();
Xl.Worksheet sheet =
(Xl.Worksheet)DotNetInsFunctions.xlApp.Worksheets[ir.GetInfo().Sheet];
while(ePointer = 0)
{
Entry e = ir.GetEntry(ePointer);
Xl.Range cell =
(Xl.Range)sheet.Cells[e.row,e.column];
cell.Value2 = e.initValue;
ePointer = ir.GetEntryPointer();
}


In the above code, if the while loop executes for 10,000 cells, it
takes 300sec to write values to 10,000 cells. If I want to do a cell
by cell writing, this is how slow it is performing..
Does anyone know of any other effective and fast way of writing stuff
to sheet in a cell by cell manner.



All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com