Project: DDEExecute May Fail When Opening a Channel to Project
  
PSS ID Number: Q111554
Article last modified on 11-16-1994
 
3.00 3.00a
 
WINDOWS
 

--------------------------------------------------------------------
The information in this article applies to:
 
 - Microsoft Project for Windows, versions 3.0, 3.0a
 - Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0
--------------------------------------------------------------------
 
SUMMARY
=======
 
In Microsoft Project, you can execute a Microsoft Excel macro from within a
Microsoft Project macro. However, if the executed Microsoft Excel macro
attempts to establish a DDE channel back to Microsoft Project, you will
receive the following error message:
 
   DDEExecute failed. The command [run("macro.xlm!macro")]
 
When you choose the Cancel button in the error message dialog box, the
Microsoft Project macro will stop and the Microsoft Excel macro will
establish the DDE channel and proceed. However, because the Microsoft
Project macro has been stopped, the Microsoft Excel macro is unable to
return control to the Microsoft Project macro.
 
MORE INFORMATION
================
 
When a Microsoft Project macro executes a Microsoft Excel macro, Microsoft
Project sends instructions to open a channel to Microsoft Excel and run the
Microsoft Excel macro. Microsoft Project then waits for Microsoft Excel to
respond with the information that the macro has completed successfully.
When the Microsoft Excel macro attempts to establish a DDE channel back to
Microsoft Project, Microsoft Project is busy and generates the error
message mentioned above.
 
Canceling the "DDEExecute failed" message terminates the Microsoft Project
macro and gives control to the Microsoft Excel macro, which is executed
correctly. When the Microsoft Excel macro is completed, however, it does
not return control to the Microsoft Project macro because the Microsoft
Project macro has been prematurely terminated.
 
Using a timeout statement on the Command Run line of the Microsoft Project
macro does not prevent the error message from being displayed; the message
is still generated, it just occurs after the timeout.
 
WORKAROUND
==========
 
To work around this problem, do either of the following:
 
 - Configure the Microsoft Excel macro to run automatically when it is
   opened. For information about running Microsoft Excel macros
   automatically, refer to the appropriate User's Guide for your version of
   Microsoft Excel.
 
 - Use the Object Packager, available in Windows 3.1, to embed the
   Microsoft Excel macro as an object in the object field of a task in
   Microsoft Project. You can then run the Microsoft Excel macro by double-
   clicking the object.
 
   For more information on using Object Packager, see page 505 of the
   "Windows 3.1 User's Guide."
 
KBCategory: kbusage
KBSubcategory:
 
Additional reference words: 3.00 3.00a 4.00 4.00a 5.00
=============================================================================
Copyright Microsoft Corporation 1994.
