I am writing a custom function in google spreadsheets. One of my inputs have to be a date since I am using date.getDate()
If the input variable is for example a string I get an #ERROR! on the cell and a generic error on the cell comments.
Using a try and catch structure:
try {
var DAYNUMBER = date.getDate();
} catch (e) {
throw ("Function parameter 1 expects a date value the value entered is not in a date format.");
}
I was able to change the error message on the comments but at the end it displays:
(line 44).
Also I would like to change the Cell value to: #VALUE! instead of the #ERROR! message.
I have been looking for documentation on how to do this, but I have been unable to find anything.
If you could point to documentation or help with how to avoid the (line 44) message and change the cell value to #VALUE! it would be appreciated.
Thanks in advance.