• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 495
  • Last Modified:

Excel VBA Sending combination keys

Hi,

How do I send the following combination keystrokes:

CTRL+SHIFT+H

followed by

24 TABS

followed by

{ENTER} key

Thanks for the help!
0
COPUSER
Asked:
COPUSER
  • 3
  • 2
1 Solution
 
PaulHewsCommented:
Like this:

SendKeys "^+H"  
For i = 1 To 24
    SendKeys "{TAB}"
Next
SendKeys "{ENTER}"
0
 
COPUSERAuthor Commented:
PaulHews:

I still have problem with SENDKEYS "^+H" line.  

When I physically push the keystrokes, I get the dialog screen as expected.  But sending the keystrokes just won't work.  The dialog screen is from an XLA program.  

0
 
PaulHewsCommented:
SendKeys is often problematic.  Do you have to enter the key combination at a particular window?  If so, what precaution do you take to ensure the window is active.
0
 
COPUSERAuthor Commented:
PaulHews:

The XLA file in question is password protected.  I need to invoke a procedure in the XLA file.  If I knew the password, I would simply call the procedure with the required variables.  Since only way I can invoke it by going through the menu (I did try ALT-U, DOWN, RIGHT, ENTER combination already but did not work) item or by calling the keyboard shortcut (CTRL-SHIFT-H).
0
 
PaulHewsCommented:
You may need to activate the window before sending key strokes.  If you send keys to the main Excel window, you can use

Application.ActiveWorkbook.Activate

before using sendkeys
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now