Hello,
In the attached example when clicked with the mouse in the cell "B4" - "RED CellBackColor" meets the B2 to P2 cells with red background color.
But moving the mouse selects cells.
How to solve this? That is, how to return control to the cells? I'm already more than a week in this routine and after several tests still can not solve it.
Any help is welcome.
Note .: - If you press the "ESC" it stops select with the mouse.
- Setting the print command "x" also stop select with the mouse.
Thanks,
Kiel
[Solved] MouseEvent And CellBackColor
[Solved] MouseEvent And CellBackColor
- Attachments
-
- MouseEvent And CellBackColor.ods
- (11.79 KiB) Downloaded 193 times
Last edited by Kiel on Mon Dec 29, 2014 3:42 am, edited 2 times in total.
OpenOffice 3.4 - LibreOffice 4.0 / 4.1 / 4.2 on Windows Seven
Re: MouseEvent And CellBackColor
1.: Do not move the mouse, while the macro is running
2.: Use Form Control elements (Buttons) or Hyperlinks associated to separated subroutines to launch the macros.
2.: Use Form Control elements (Buttons) or Hyperlinks associated to separated subroutines to launch the macros.
Code: Select all
Sub ResetBackroundColor
oDoc = ThisComponent.CurrentSelection
oSheet = ThisComponent.Sheets(oDoc.RangeAddress.Sheet)
oCell=oSheet.getCellRangeByName("B2:P2")
oCell.clearContents(23)
oCell.CellBackColor=RGB(255,255,255)
End Sub
Sub SetBackroundColor
oDoc = ThisComponent.CurrentSelection
oSheet = ThisComponent.Sheets(oDoc.RangeAddress.Sheet)
For i=1 to 15
oCell=oSheet.getCellByPosition(i,1)
oCell.CellBackColor=RGB(255,51,51)
Wait 100
Next
End Sub
Last edited by Zizi64 on Mon Dec 29, 2014 10:46 am, edited 1 time in total.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: MouseEvent And CellBackColor
Thank Zizi64,
I studied his suggestion and will be used.
Another suggestion, which is also thank the Piaf, which follows in the attached file.
Hugs,
Kiel
I studied his suggestion and will be used.
Another suggestion, which is also thank the Piaf, which follows in the attached file.
Hugs,
Kiel
- Attachments
-
- [Solved] MouseEvent And CellBackColor.ods
- (18.75 KiB) Downloaded 218 times
OpenOffice 3.4 - LibreOffice 4.0 / 4.1 / 4.2 on Windows Seven