XL: DDE EXIT() Returns #VALUE! Error Value

ID: Q108723

1.00 WINDOWS kbother kbprb kbtool

The information in this article applies to:

SYMPTOMS

When a macro initiates a DDE channel to Microsoft Query and sends the EXIT() command from within the EXECUTE() function, the command will be evaluated to a #VALUE! error value.

When you have a query open in Microsoft Query, the application will not end and will evaluate to a #REF! error value. Using the EXIT(TRUE) function will always end Microsoft Query and evaluate to the #VALUE! error value. EXIT() or EXIT(FALSE) will close Microsoft Query only if there are no open queries that were opened on another channel.

MORE INFORMATION

The errors are returned when you execute a command through a DDE channel because Microsoft Query can only successfully return to Microsoft Excel after it has executed the entire command successfully. Once the application has terminated, it cannot return a response back to Microsoft Excel (at which time a #VALUE! error value must be returned).

Steps to Reproduce the Problem

1. Run Microsoft Query

2. Switch to Program Manager and run Microsoft Excel 5.0

3. From the Insert menu, choose Macro, and then choose MS Excel 4.0 Macro

   sheet.

4. Enter the following macro:

      A1: chan=INITIATE("MSQuery","system")
      A2: =EXECUTE(chan,"[EXIT()]")
      A3: =HALT()

5. Run and step through the macro.

A2 above evaluates to a #VALUE! error value. Note that Microsoft Query has been closed.

KBCategory: kbother kbprb kbtool KBSubcategory: xlquery

Additional reference words: 1.00 5.00 7.00

Keywords          : xlquery 
Version           : 1.00
Platform          : WINDOWS

Last Reviewed: March 30, 1997