ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Ribbon Custom Tab Focus (https://www.excelbanter.com/excel-programming/426912-ribbon-custom-tab-focus.html)

Dovy

Ribbon Custom Tab Focus
 
I am trying to set focus on one of a number of custom tabs.
I use the Keytip technique:
1. In XML - Define a Keytip
2. In VBA - Application.SendKeys "%ZYX{RETURN}"
It works, however I also get a Beep, indicating some error.
What could be the problem?

Homey

Ribbon Custom Tab Focus
 
Might not need {return} see if work without

"Dovy" wrote in message
...
|I am trying to set focus on one of a number of custom tabs.
| I use the Keytip technique:
| 1. In XML - Define a Keytip
| 2. In VBA - Application.SendKeys "%ZYX{RETURN}"
| It works, however I also get a Beep, indicating some error.
| What could be the problem?


Dovy

Ribbon Custom Tab Focus
 
On Apr 15, 9:55*am, "Homey" <none wrote:
Might not need {return} see if work without

"Dovy" wrote in message

...
|I am trying to set focus on one of a number of custom tabs.
| I use the Keytip technique:
| 1. *In XML - Define a Keytip
| 2. *In VBA - Application.SendKeys "%ZYX{RETURN}"
| It works, however I also get a Beep, indicating some error.
| What could be the problem?


{Return} is necessary to get the focus away from the ribbon.
I took me some time, but I found the problem.
When you try to change focus with SendKeys technique, the tab get
selected as soon as Excel detects a unique value. Since there is no
other tab with keytip starting with Z, excel fired the selection when
Z was sent, then complained with a beep when YX were sent. Manual
operation using ALT+ works just fine with all three characters.
Dovy


All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com