Microsoft KB Archive/74520

{| = Executing the FORM? Function from Another Application =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q74520

SUMMARY
As stated in the &quot;Q+E for Microsoft Excel User's Guide&quot; on page 98, the FORM? function cannot be executed from another application by using DDE (dynamic data exchange).

Steps to Reproduce
  Create and run the following macro. A1: chan=INITIATE(&quot;QE&quot;,&quot;SYSTEM&quot;) A2: =APP.ACTIVATE(&quot;Q+E&quot;) A3: =EXECUTE(chan,&quot;[open('query1.qef')]&quot;) A4: =TERMINATE(chan) A5: =RETURN where 'query1.qef' contains: Q+E 3.0 for dBASEFile SELECT ALL FROM C:\EXCEL\QE\EMP.DBF Compatibility=DBASE,CharSet=IBMPC); form? 

The correct records are displayed but the FORM? command is ignored. If you open this query file in Q+E, all records from EMP.DBF are displayed and then the FORM? dialog box is brought up.

Workaround
FORM? can be executed from a macro using the Send.keys command as shown below.

A1: chan=INITIATE(&quot;QE&quot;,&quot;SYSTEM&quot;) A2:=ERROR(FALSE) A3: =SEND.KEYS(&quot;%fo&quot;,FALSE) A4: =SEND.KEYS(&quot;%c:\excel\qe\query1.qef~&quot;) A6: =RETURN Note: This example assumes that Q+E is either running or in your path. You may need to modify line 4 to refer to the correct locations of the query file you want to open.