Debugging COM Interop HResult codes (VSTO)

-1

I have an Excel add-in firing an HRESULT 0x800401A8 error, when calling the getter of Worksheet.Parent.

I would be glad if anyone could let me know what the error might be, but more importantly and more generally, I would like to know how I can understand these HResult codes?

I did the following but am still confused:

debugging
com
vsto
office-interop
hresult
asked on Stack Overflow Feb 20, 2020 by Ama • edited Apr 4, 2020 by Ama

2 Answers

1

I don't think understanding the structure will help you much.

The most basic information is that

  • success is indicated by S_OK = 0
  • success may also be indicated by S_FALSE = 1
  • all negative numbers are errors

There is an "Error Lookup" tool from Microsoft, which is still in the Visual Studio Tools menu, but it looks like it hasn't been updated for about 20 years.

enter image description here

Honestly, the best way to find details is to google the hex number, or to search directly in Stack Overflow.


Edit

For me, the command is in the tools menu

enter image description here

This may be related to the options that I selected in the Visual Studio Installer. Among several other options, I have selected the workload "Desktop development in C++".

It looks like you can download it here:

https://www.microsoft.com/en-us/download/details.aspx?id=100432

but I have not tried out that link.

answered on Stack Overflow Feb 21, 2020 by Phil Jollans • edited Feb 24, 2020 by Phil Jollans
-1

Worksheet doesn't actually have parent and you can't access nor inherit worksheet class tho you can extend it.

answered on Stack Overflow Feb 21, 2020 by Mario Morazan

User contributions licensed under CC BY-SA 3.0