Do not shift focus when users click userform

John Yazou

New Member
Joined
Mar 17, 2002
Messages
49
Hi all,
I wrote a macro for Attachmate Extra! personal client. Due to company policy, they disabled the macro running feature on the software. Luckily, the software supports VBA & I was able to access the objects using Excel. The macro is executed when users press a command button I put on a form loaded with Excel ie control Attachmate Extra! using Extra. My question:
1. In Excel -> Whenever users press the command button, the focus is shifted to Excel. I have not been able to disable the TakeFocusOnClick for the Application/UserForm class. Any way to do this??
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi,

Do you mean the focus is on Excel worksheet once the button is click? Or perhaps the focus remains on the Userform itself?
 
Upvote 0
I want the focus to remain on the application I am controlling. My solution at the moment is to do SendKeys "%{TAB}" to alt-tab back to Extra!. Wondering if there's a more elegant solution...
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,273
Members
448,559
Latest member
MrPJ_Harper

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top