ewessely
Posts: 55
Joined: 2019-01-31
|
Hello Andrei,
I'm looking for a onClick event for excel worksheets...
Situation: My wizard opens a (windows) form allowing the user to enter cell references. The user should also be able to enter a reference by simply clicking on a cell. I then take the cell as refence.
Current solution: I use the ExcelAppEvent SheetSelectionChange which gives me sheet + range I need.
Problem: The user may also click on a cell which is allready selected, so no SheetSelectionChange will be triggered. (of course - this is behav. is expected....). Currently the user has to select any cell and the again click on the desired on - functional, but dirty solution :-(
So: which event will be fired when my wizard is open, when a user clicks on an allready selected cell/range? Doing similar with the excel built in function wizard gets the cell reference. So I'm sure, there should be such an event.
Do you have any hint for me?
br
Erichew |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Hello Erich,
There's no onClick event. Do you get the WindowActivate event after you switch from your form to the Excel window?
Andrei Smolin
Add-in Express Team Leader |
|
ewessely
Posts: 55
Joined: 2019-01-31
|
Hello Andrei,
unfortunately no.
I also tried my luck with worksheet event: ProcessMouseDown does not fire and ProcessBeforeRightClick would work but is the wrong mouse button...
br
Erichew |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Hello Erich,
There's the CommandBars.OnUpdate event. In Add-in Express it is mapped to {Excel events component}.CommandbarsUpdate. Check if it occurs when you move the focus from your wizard to Excel.
Andrei Smolin
Add-in Express Team Leader |
|
ewessely
Posts: 55
Joined: 2019-01-31
|
Hello Andrei,
you are my hero!
CommandbarsUpdate fires when my wizard is open and I click on a cell. It's exactly what I'm looking for!
It seems that CommandbarsUpdate fires very often when my wizard is not open or does not have the focus. Minimum 1 time /sec. Tried to find out the origin without success. But it seems not to a problem for performance.
Many thanks and have a nice weekend!
Erichew |
|