ID: Q133710
The information in this article applies to:
This article contains an example to demonstrate how Microsoft Excel can run a Microsoft Project macro using DDE (dynamic data exchange) and Visual Basic for Applications code.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
   http://www.microsoft.com/support/supportnet/refguide/
1. In Microsoft Excel, create a new workbook.
2. In Microsoft Excel 97, click the Tools menu, point to Macro, and click
   Visual Basic Editor. Then, click Module on the Insert menu.
   In earlier versions, on the Insert menu, click Macro, and then click
   Module.
   alter the macro to specify the appropriate locations for the files on
   your computer):
   Sub Run_Project_Macro()
       'Opens Microsoft Project
       Shell("c:\project\winproj.exe")
       'Initiates a DDE channel to Microsoft Project
       Chan = DDEInitiate("WINPROJ", "system")
       'Activates Microsoft Project
       Application.ActivateMicrosoftApp xlMicrosoftProject
       'Runs the Project global macro "AdjustDates"
       Application.DDEExecute Chan, "AdjustDates"
       'Terminates the DDE channel
       Application.DDETerminate Chan
   End Sub
   appropriate macro name and then click Run.
   ARTICLE-ID: Q99845
   TITLE     : Excel: Communication Between Excel and Access Using DDE
Keywords          : kbinterop kbprg kbdta kbdtacode KbVBA offinterop xlwin 
Version           : WINDOWS:5.0,5.0c,7.0,97
Platform          : WINDOWS
Issue type        : kbhowtoLast Reviewed: May 17, 1999