Send.Keys Macro to Size Window Doesn't Work in ExcelLast reviewed: November 2, 1994Article ID: Q76309 |
SUMMARYThe Excel macro shown below uses the SEND.KEYS command to activate another application (Q+E in this example) and then attempts to resize the application window. Running this macro may hang your machine.
MORE INFORMATIONThe body of the following macro contains three Send.Keys commands. The first statement (A1) activates Q+E. The second statement (A2) chooses Size from the Control menu and the Sizing Arrow is displayed on the screen. The third Send.Keys (A3) should then resize the window, but may instead lock up your machine, causing you to have to reboot. Microsoft is researching this problem and will post new information here as it becomes available. NOTE: A workaround follows the "Steps to Reproduce Problem" section.
Steps to Reproduce Problem
This macro works correctly in Excel for OS/2. This macro will also work if you attempt to use it to resize an Excel worksheet in the same instance of Excel.
WorkaroundCombining the second and third statements into one causes the macro to run properly because all the keystrokes are sent to Q+E at one time:
A1: =SEND.KEYS("^{ESC}Q%S",TRUE) A2: =SEND.KEYS("%( )S {LEFT}{RIGHT 5}~",TRUE) A3: =RETURN()Reference(s) : "Microsoft Excel Function Reference," version 3.0, page 166
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |