c# - reducing Excel access time -


i'm working in c# excel files, using microsoft.office.interop.excel. problem program runs slow. basically, iterate through cells of excel sheet, , read data in each 1 of cells.

i use following command:

value = (range.cells[row, col] excel.range).value2; 

where value variable, , range interop.excel object of range class.

is there beter way in interop access access file , or library should use?

if @ possible, use library epplus, more faster interop , lot easier program.

if not possible due external constraints, try reduce number of interop calls as possible. doing looping in excel asking trouble - since each cell has acessed via interop , marshalling of data excel app eats lot of time. better use get_range() whole array in 1 go. single request take long time, looping in c# extremely fast afterwards. in general, beneficial can on c# side - if excel offer same functionality.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -