I am using c# VSTO and Interop lib for developing excel add-in. for validating each cell's value before pasting these values into another workbook with formatting. My actual query is to process, (in fastest possible way) cells with some criteria.
I have used WorkSheet.Cells.SpecialCells() for getting Excel.Range objects of my interest and use threads for processing Excel.Range (which is returned by SpecialCells()) simultaneously. Following are the some of the observations/issues:
- It seems Excel.Range can not be split based on offset and length (i.e I cant get the new Range object from existing Range based on some offset and count)
- If we shared the range object in threads and try to process the cells in different batches we get following exception: "The message filter indicated that the application is busy. (Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))" This also leaves that batch of cells unprocessed.
Any inputs or pointers to resolve the aforementioned issues would be helpful. Also any suggestions on processing large excel files quickly, say in seconds (this is the biggest bottle neck for now)