This documentation is archived and is not being maintained.

Visual Basic Reference

Visual Studio 6.0

LinkError Event

See Also    Example    Applies To

Occurs when there is an error during a DDE conversation. This event is recognized only as the result of a DDE-related error that occurs when no Visual Basic code is being executed. The error number is passed as an argument.


Private Sub Form_LinkError(linkerr As Integer)

Private Sub MDIForm_LinkError(linkerr As Integer)

Private Sub object_LinkError([index As Integer,]linkerr As Integer)

The LinkError event syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
linkerr Error number of the DDE-related error, as described in Return Values.
index An integer that uniquely identifies a control if it's in a control array.

Return Values

The following table lists all error numbers returned for the linkerr argument and a brief explanation of each error:

Value Description
1 The other application has requested data in the wrong format. This error may occur several times in succession as Visual Basic tries to find a format the other application recognizes.
6 The destination application attempted to continue a DDE conversation after you set the LinkMode property on your source form to 0 (None).
7 All the source links are in use (there is a limit of 128 links per source).
8 For destination controls: An automatic link or LinkRequest method failed to update the data in the control.
For source forms: The destination attempted to poke data to a control and the attempt failed.
11 Not enough memory for DDE.


Use a LinkError event procedure to notify the user of the particular error that has occurred. You can also include code to fix the problem or troubleshooting information on reestablishing a connection or on where to go for assistance. For brief messages, use the MsgBox function.