MBS LibXL write #NV problem

Hello, I have a problem:
I want to write an error in an Excel file. Unfortunately the error is only accepted as a string. Only when I open the file in Excel and press the Enter key in the cell does it work. what am I doing wrong?

call sheet1.WriteError(1,1,XLSheetMBS.CellTypeError)
call sheet1.WriteString(1,1,"#NV")

WriteError(row as Integer, col as Integer, Error as Integer, format as XLFormatMBS = nil)

Well, you need to pass the error number as parameter, not the cell type.
And then no WriteString, please.

Danke funktioniert:
call sheet1.WriteError(1,1,XLSheetMBS.ErrorTypeNA)

1 Like