From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- helpcontent2/source/text/scalc/01/12120300.xhp | 83 ++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 helpcontent2/source/text/scalc/01/12120300.xhp (limited to 'helpcontent2/source/text/scalc/01/12120300.xhp') diff --git a/helpcontent2/source/text/scalc/01/12120300.xhp b/helpcontent2/source/text/scalc/01/12120300.xhp new file mode 100644 index 000000000..4b0079d65 --- /dev/null +++ b/helpcontent2/source/text/scalc/01/12120300.xhp @@ -0,0 +1,83 @@ + + + + + + + Error Alert + /text/scalc/01/12120300.xhp + + + Sun Microsystems, Inc. + + + +
+ + + Error Alert + Defines the error message that is displayed when invalid data is entered in a cell. +
+You can also start a macro with an error message. A sample macro is provided at the end of this page. +
+ +
+ +Show error message when invalid values are entered. +Displays the error message that you enter in the Contents area when invalid data is entered in a cell. If enabled, the message is displayed to prevent an invalid entry. +In both cases, if you select "Stop", the invalid entry is deleted and the previous value is reentered in the cell. The same applies if you close the "Warning" and "Information" dialogs by clicking the Cancel button. If you close the dialogs with the OK button, the invalid entry is not deleted. +Contents + +Action +Select the action that you want to occur when invalid data is entered in a cell. The "Stop" action rejects the invalid entry and displays a dialog that you have to close by clicking OK. The "Warning" and "Information" actions display a dialog that can be closed by clicking OK or Cancel. The invalid entry is only rejected when you click Cancel. + +Browse +Opens the Macro dialog where you can select the macro that is executed when invalid data is entered in a cell. The macro is executed after the error message is displayed. + +Title +Enter the title of the macro or the error message that you want to display when invalid data is entered in a cell. + +Error message +Enter the message that you want to display when invalid data is entered in a cell. +

Sample macro:

+ Below is a sample function that can be called when an error occurs. Note that the macro takes in two parameters that are passed on by %PRODUCTNAME when the function is called: + + + CellValue: The value entered by the user, as a String. + + + CellAddress: The address of the cell where the value was entered, as a String prefixed with the sheet name (e.g: "Sheet1.A1"). + + + The function must return a Boolean value. If it returns True, the entered value is kept. If the function returns False, the entered value is erased and the previous value is restored. + + Function ExampleValidity(CellValue as String, CellAddress as String) as Boolean + Dim msg as String + Dim iAnswer as Integer + Dim MB_FLAGS as Integer + msg = "Invalid value: " & "'" & CellValue & "'" + msg = msg & " in cell: " & "'" & CellAddress & "'" + msg = msg & Chr(10) & "Accept anyway?" + MB_FLAGS = MB_YESNO + MB_ICONEXCLAMATION + MB_DEFBUTTON2 + iAnswer = MsgBox (msg , MB_FLAGS, "Error message") + ExampleValidity = (iAnswer = IDYES) + End Function + + +
-- cgit v1.2.3