how to output a CVError(#N/A, #NULL, #VALUE!) to excel cell?

Add-in Express™ Support Service
That's what is more important than anything else

how to output a CVError(#N/A, #NULL, #VALUE!) to excel cell?
 
Ming Chao




Posts: 30
Joined: 2019-01-23
Hi,

currently i'm working on a excel app in c# that's outputting a table of data to excel. My approach is simply setting range.value2 to a 2D array. For error handling, i needed to set the cell value to one of the CVErrors(#N/A, #NULL, #VALUE! etc) based on the error type. the problem is excel renders the enum as an number when i tried the line below. i expected the cell to be #VALUE! than 15. how can i convert it to a CVError?

ActiveCell.Value2 = AddinExpress.MSO.xlErrorValue
Posted 16 Oct, 2019 11:32:32 Top
Ming Chao




Posts: 30
Joined: 2019-01-23
found the solution from a previous post. if anyone is facing a similar problem could take a look the link below.
https://www.add-in-express.com/forum/read.php?FID=5&TID=14266
Posted 17 Oct, 2019 08:56:47 Top
Andrei Smolin


Add-in Express team


Posts: 18791
Joined: 2006-05-11
Hello Ming,

Many thanks for posting that link!


Andrei Smolin
Add-in Express Team Leader
Posted 17 Oct, 2019 09:05:05 Top