Microsoft KB Archive/95107

{|
 * width="100%"|

WordBasic Error Code 500: Cannot Initiate Link Using DDE

 * }

Q95107

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
 * Microsoft Word for Windows, version 7.0

-

SUMMARY
In Word for Windows, the WordBasic Error Code Number 500, &quot;Cannot initiate link,&quot; 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$ = &quot;C:\Excel&quot; Topic$ = &quot;C:\Excel\Sales.Xls&quot;

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 &quot;Cannot initiate link&quot; 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 &quot;C:\Excel\Excel.exe&quot; REM Initiates DDE link ChanNum1 = DDEInitiate(&quot;C:\EXCEL&quot;,&quot;C:\EXCEL\EXPENSES.XLS&quot;) REM Terminates all DDE links DDETerminateAll End Sub For more information on DDE, please refer to the &quot;Microsoft Word for Windows Technical Reference&quot; (Word for Windows versions 1.0-2.0c), and the &quot;Microsoft Word Developers Kit&quot; (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:

"Q102019 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 &quot;as is&quot; 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.

Additional query words: 1.0 1.10a 2.0 winword2 winword 6.0 7.0 word95 word7 word6

Keywords : kbofficeprog

Issue type :

Technology :