Use the KEYS Function to Send an Array of Data to Q+E

Last reviewed: November 2, 1994
Article ID: Q74236

SUMMARY

The 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 INFORMATION

In addition to numbers and text, you can send the following keystrokes:

 TAB, LEFT ARROW, RIGHT ARROW, UP ARROW, and DOWN ARROW

The 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 E56987

Note: 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
KBSubcategory:

Additional reference words: noupd


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.