-2146826246 in win32com.client for empty #N/A cell in Excel

random832 at fastmail.us random832 at fastmail.us
Sun Aug 16 23:39:30 CEST 2015


On Sun, Aug 16, 2015, at 14:41, Chris Angelico wrote:
> On Mon, Aug 17, 2015 at 3:27 AM, Albert-Jan Roskam
> <sjeik_appie at hotmail.com> wrote:
> > Does that number happen to be -1 * sys.maxint?
> 
> No, it's -1 * 0x7ff5f806. As a signed 32-bit integer, it's 0x800a07fa.
> Does either of those numbers mean anything?

That's a COM error code, for Excel error 2042, which (unsurprisingly)
means N/A.

http://stackoverflow.com/questions/7526640/any-ideas-why-excel-interop-reads-many-decimals-as-2146826246

Here's some information from someone having the same problem in .NET,
which may or may not be helpful

https://xldennis.wordpress.com/2006/11/22/dealing-with-cverr-values-in-net-%E2%80%93-part-i-the-problem/

It looks like the values are actually returned as a VT_ERROR variant,
which .NET (and apparently python) reads as an integer.


More information about the Python-list mailing list