Use the KEYS Function to Send an Array of Data to Q+ELast reviewed: November 2, 1994Article ID: Q74236 |
SUMMARYThe KEYS function allows you to send keystrokes to Q+E using DDE (dynamic data exchange). You might want to use KEYS instead of the POKE command in situations where you want to concatenate data from various locations into a string and send it to Q+E.
MORE INFORMATIONIn addition to numbers and text, you can send the following keystrokes:
TAB, LEFT ARROW, RIGHT ARROW, UP ARROW, and DOWN ARROWThe following examples enter a new Last_Name, First_Name, and Employee_Number in the first record in EMP.DBF. Line 1 starts Q+E and open the sample file EMP.DBF, which is placed in the QE subdirectory when you install Q+E. You may need to modify the path in cell A1 to point to the correct location of EMP.DBF in your system. Line 2 turns on Allow Editing. Line 3 selects cell R1C1 in Q+E. Line 4 places the text "Tami" in cell R1C1, tabs to cell R1C2, and enters "Sanders," then tabs to cell R1C3 and enters "E56987."
Example 1
A1 chan=INITIATE("qe","select * from dbasefile|c:\excel\qe\emp.dbf") A2 =EXECUTE(chan,"[allow.edit(TRUE)]") A3 =EXECUTE(chan,"[select.area('R1C1')]") A4 =EXECUTE(chan,"[keys('Tami{tab}Sanders{tab}E56987')]") A5 =TERMINATE(chan) A6 =RETURN() Example 2
A1 chan=INITIATE("qe","select * from dbasefile|d:\excel\qe\emp.dbf") A2 =EXECUTE(chan,"[allow.edit(TRUE)]") A3 =EXECUTE(chan,"[select.area('R1C1')]") A4 =EXECUTE(chan,"[keys('"&A8&"{tab}"&A9&"{tab}"&A10&"')]") A5 =TERMINATE(chan) A6 =RETURN() A7 A8 Tami A9 Sanders A10 E56987Note: In line A4 of the second example, both the first and last text strings that are being concatenated together contain a single quotation mark. The first string is read as:
"double quotation mark", "open square bracket", "k", "e", "y", "s", "open parenthesis", "single quotation mark", "double quotation mark" REFERENCES"Q+E for Microsoft Excel User's Guide," page 99.
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |