If I am on a chart-sheet and I select an (any) element and then I move away from that sheet, I'd like all selections to be undone (so that the next time I select the chart-sheet, nothing is selected).
Without Sendkeys, how do I do that? I tried some stuff but I can't seem to fix this yet...
Chart unselect
-
- BronzeLounger
- Posts: 1232
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
-
- Administrator
- Posts: 78439
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Chart unselect
I found this:
Code: Select all
With ActiveSheet ' Or Sheets("MyChart")
.Protect
.Unprotect
End With
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1232
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Chart unselect
Thanks, looks like it's the "Protect" that un-selects
-
- BronzeLounger
- Posts: 1232
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Chart unselect
Which brings my next problem... I'd like the chart to be protected but still selected ;-)
Somehow I can have a protectionmode = true and still have the chart selected if i do things manually (Excel Ribbon says "Unprotect Sheet" so it is protected). But I can't make that happen in VBA yet
Somehow I can have a protectionmode = true and still have the chart selected if i do things manually (Excel Ribbon says "Unprotect Sheet" so it is protected). But I can't make that happen in VBA yet
-
- Administrator
- Posts: 78439
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Chart unselect
Do you want the ChartArea to be selected, or the PlotArea, or ...?
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1232
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Chart unselect
Doesn't matter really I think...
I'm working on a "chart highlighter". If my mouse moves over a chart series it will change color.
The event only triggers if the chart is selected first. At the same time, I don't want the user to make any changes...
Of course I'm only refining some code I found already; I'll share here when things work the way I want them to work...
I'm working on a "chart highlighter". If my mouse moves over a chart series it will change color.
The event only triggers if the chart is selected first. At the same time, I don't want the user to make any changes...
Of course I'm only refining some code I found already; I'll share here when things work the way I want them to work...
-
- Administrator
- Posts: 78439
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Chart unselect
I don't think it's possible to select anything on a protected chart sheet using VBA.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1232
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Chart unselect
I don't need to select, just hover with my mouse (but the chart should be selected)
-
- Administrator
- Posts: 78439
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands