To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=54957
Issue #:|54957
Summary:|Accept correction macro for validity
Component:|Spreadsheet
Version:|OOO 2.0 Beta2
Platform:|All
URL:|
OS/Version:|All
Status:|UNCONFIRMED
Status whiteboard:|
Keywords:|
Resolution:|
Issue type:|ENHANCEMENT
Priority:|P3
Subcomponent:|programming
Assigned to:|spreadsheet
Reported by:|bluedwarf
------- Additional comments from [EMAIL PROTECTED] Thu Sep 22 02:42:54 -0700
2005 -------
Try follwing manipulation:
1. Choose "Data - Validity"
2. Define that 0 to 100 integers are valid for selected cells
3. Select following macro for "Action" in "Error Alert" tab
4. Enter invalid value such as -1 in the configured cell
5. The Background color comes to be red, but the content is still -1
I excpect that the content comes to be 0 at the last step. OOo, however,
overwrite the cell with the original value, which is invalid, after the
following macro runs.
This behavior is incorrect. If no fix, no way to correct invalid values for
macro action. OOo should not overwrite the cell content which macros handle.
=====
Sub Correction(CellValue As String, TableCell As String)
Dim I As Integer, CurVal As String
Dim SheetName As String, CellName As String
Dim oDoc As Object, oSheet As Object, oCell As Object
I = InStr(TableCell, ".")
SheetName = Left(TableCell, I - 1)
CellName = Right(TableCell, Len(TableCell) - I)
oDoc = ThisComponent
oSheet = oDoc.Sheets.getByName(SheetName)
oCell = oSheet.getCellRangeByName(CellName)
CurVal = Int(CellValue)
MsgBox "Invalid value '" & CurVal & "' for " & CellName
If CurVal > 100 Then
oCell.Value = 100
oCell.CellBackColor = RGB(255, 0, 0)
ElseIf CurVal < 0 Then
oCell.Value = 0
oCell.CellBackColor = RGB(0, 0, 255)
EndIf
End Sub
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]