Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > PC based Database Applications > Microsoft Excel > Ctl key pressed after Ctl+Tab OnKey activation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-12-08, 20:33
savbill savbill is offline
Registered User
 
Join Date: Feb 2004
Posts: 525
Ctl key pressed after Ctl+Tab OnKey activation

I have script that sets this OnKey command then activates another open Excel Application window with an API Activate and uses SendKey commands to display the Find dialog to search for matching value.

The problem is when you activate the main Sub procedure "GoToFind()" the second time using the key combo Ctl+Tab, the Ctl key acts like it is still pressed when you select the original window. It acts like the Ctl key is still pressed until you press the Ctl key one extra time. (On the first run the Procedure is activated by the toolbar button which sets up the shortcut key command for ease of use)

The Procedure "GoToFind()" operates in 2 modes. If there's 2 Excel App windows open it goes to the open app window which is not active. If only one app window is open it goes to the Next Workbook Window in the same Excel App. So it still sets the key combo but there is not a problem as long as the same window remains the active window. The problem is related to changing application windows while the script is executing.

I don't think there's an easy answer to this, exept maybe tell the user to press the Ctl key again after using the shortcut method to activate the process.

Code:
Sub SetWinShortcutKey(strProcName As String) ' Set Ctl+Tab Shortcut Application.OnKey "^{TAB}", strProcName End Sub
__________________
~

Bill
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On