Microsoft KB Archive/108723

From BetaArchive Wiki

Article ID: 108723

Article Last Modified on 8/15/2005



APPLIES TO

  • Microsoft Excel 95 Standard Edition
  • Microsoft Excel 5.0 Standard Edition
  • Microsoft Query 2000



This article was previously published under Q108723


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.


Additional query words: XL

Keywords: KB108723