Chybové hlásenie
Defines the error message that is displayed when invalid data is entered in a cell.
Na začiatok makra je možné umiestniť chybovú správu. Príklad takéhoto makra si môžete pozrieť na konci tejto stránky.
Zobraziť chybovú správu, keď sú zadané neplatné hodnoty
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.
V oboch prípadoch platí, že ak označíte "Zastaviť", tak neplatný vstup je nahradený pôvodným obsahom bunky. Rovnaké správanie platí pre prípad, keď dialógy "Upozornenie" a "Informácia" ukončíte tlačidlom Zrušiť . Ak ukončíte dialógy tlačidlom OK, potom nie je neplatný vstup nahradený.
Obsah
Činnosť
Označte činnosť, ktorá bude vykonaná, keď bude do bunky zadaný neplatný vstup. Činnosť "Zastaviť" odmietne neplatný vstup a zobrazí dialóg, ktorý ukončíte tlačidlom OK. Činnosti "Upozornenie" a "Informácia" zobrazí dialóg, ktorý môže byť ukončený kliknutím na OK alebo Zrušiť. Neplatný vstup je odmietnutý iba keď kliknete na Zrušiť.
-
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.
-
The Reject Silently action keeps the current cell value and does not display a dialog.
Prehľadávať
Otvorí Makrodialóg, v ktorom je možné vybrať makro, ktoré je spustené, keď sú zadané neplatné dáta do bunky. Makro je spustené až po zobrazení chybovej správy.
Nadpis
Zadajte nadpis makra alebo chybovej správy, ktorá bude zobrazená po zadaní neplatných dát do bunky.
Chybová správa
Zadajte správu, ktorú chcete zobraziť po zadaní neplatných dát do bunky.
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 Collabora Office 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