WordBasic Error Code 500: Cannot Initiate Link Using DDE

ID: Q95107

The information in this article applies to:

SUMMARY

In Word for Windows, the WordBasic Error Code Number 500, "Cannot initiate link," indicates the macro program cannot initiate a DDE link.

The syntax is as follows:

   ChanNum = DDEInitiate(App$,Topic$)

The above line opens a DDE channel to an application. App$ is the application name defined by the other application. Topic$ describes something in the application you are accessing, usually the document containing the data you want to use.

The following is an example:

   App$ = "C:\Excel"
   Topic$ = "C:\Excel\Sales.Xls"

   ChanNum = DDEInitiate(App$,Topic$)

When this command is executed, the error is displayed.

This error occurs when the application parameter being passed contains only a path to the application. Despite the error, the link is established.

The error message "Cannot initiate link" will not be issued when the path to the file is designated in the file information section of the ChanNum statement. For example, the following will not produce the error:

   Sub MAIN
   REM Launches Excel if not running
   Shell "C:\Excel\Excel.exe"
   REM Initiates DDE link
   ChanNum1 = DDEInitiate("C:\EXCEL","C:\EXCEL\EXPENSES.XLS")
   REM Terminates all DDE links
   DDETerminateAll
   End Sub

For more information on DDE, please refer to the "Microsoft Word for Windows Technical Reference" (Word for Windows versions 1.0-2.0c), and the "Microsoft Word Developers Kit" (Word for Windows versions 6.0-7.0).

For additional information on the WordBasic shell command, please see the following article in the Microsoft Knowledge Base:

ARTICLE-ID: Q102019

TITLE     : WordBasic Shell Command Doesn't Wait for Application to Finish

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

KBCategory: kbmacro KBSubcategory: Additional query words: 1.0 1.10 1.10a 2.0 2.0a winword2 winword 2.0a-CD 2.0b 2.0c 6.0 6.0a 6.0c 7.0 word95 word7 word6 Version : 1.0 1.10 1.10a 2.0 2.0a 2.0a

Last Reviewed: July 30, 1997