Any ideas why excel interop reads many decimals as -2146826246?
I'm absolutely sure that I haven't changed a thing.
For some reason, excel 开发者_JAVA百科interop has started reading cells with decimals with same mystic value:
-2146826246
I'm absolutely clueless on what to do next, what to look for.
OS: windows7 enterprise edition, MSOffice: 2010 professional plus
Any ideas what this could be?
Recent updates:
It is not that unusual. When you convert it to hex, you get 0x800A07FA. Which is an error code. The last 4 digits is the Excel error, producing 2042. Google "Excel error 2042", first hit tells you it means "match not found" or "#N/A".
That's as much as I can reverse-engineer. Start by taking a critical look at the error handling in your code. Don't mess with the install.
I am not familiar with Excel Interop but this appears to be related to a limitation of .net's understanding of Excel's various CVErr values.
There is an excellent write up on this at: dealing with cverr values
精彩评论