Pages

Showing posts with label Interop. Show all posts
Showing posts with label Interop. Show all posts

Friday, 16 July 2010

DISP_E_OVERFLOW

When working with Interop Excel, is better to read values from a given cell by using mySheet.Range("A2").Value2 instead of mySeet.Range("A2").Value. This is because when a cell is not displaying the whole content, for instance "######" the property Value will throw the exception DISP_E_OVERFLOW, but when you are using Value2 you will get the actual value inside the cell rather than the value displayed on the screen.