LibreOffice 24.8 abi
Defines the error message that is displayed when invalid data is entered in a cell.
Makrot saab alustada ka veateatega. NĂ€idismakro on toodud selle lehekĂŒlje lĂ”pus.
Lahtrisse lubamatute andmete sisestamisel kuvatakse veateade, mille oled sisestanud alas Sisu. Kui see on lubatud, kuvatakse teade lubamatu kirje takistamiseks.
Kui oled valinud "Peata", siis kummalgi juhul lubamatu kirje kustutatakse ja lahtrisse sisestatakse uuesti eelmine vÀÀrtus. See kehtib ka juhul, kui klÔpsad dialoogide "Hoiatus" ja "Teave" sulgemiseks nupul Loobu. Kui suled need dialoogid nupuga Sobib, siis lubamatut kirjet ei kustutata.
Vali toiming, mille soovid lubamatute andmete lahtrisse sisestamisel kĂ€ivitada. Toimingu "Peata" korral lĂŒkatakse lubamatu kirje tagasi ja kuvatakse dialoog, mille sulgemiseks tuleb klĂ”psata nupul Sobib. Toimingute "Hoiatus" ja "Teave" korral kuvatakse dialoog, mille sulgemiseks vĂ”ib klĂ”psata nii nupul Sobib kui ka Loobu. Lubamatu kirje lĂŒkatakse tagasi ĂŒksnes nupul Loobu klĂ”psamise korral.
Avab dialoogi Makro, kus saab mÀÀrata makro, mis kÀivitatakse, kui lahtrisse sisestatakse sobimatu vÀÀrtus. Makro kÀivitatakse pÀrast veateate nÀitamist.
Sisesta makro nimi vÔi veateade, mida soovid lasta nÀidata, kui lahtrisse sisestatakse sobimatu vÀÀrtus.
Sisesta teade, mida nÀidatakse, kui lahtrisse sisestatakse sobimatu vÀÀrtus.
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 LibreOffice 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