Microsoft KB Archive/102018: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 42: | Line 42: | ||
== CAUSE == | == CAUSE == | ||
When using DDE to communicate between applications, a separate | When using DDE to communicate between applications, a separate "channel" or line of communication for each DDE conversation is created. It is possible to have multiple DDE conversations happening at the same time. While there is no absolute limit to the number of DDE conversations that can exist simultaneously, there is a relative limit that depends on the amount of system resources available. This limit will vary from system to system. | ||
<br /> | <br /> | ||
Line 49: | Line 49: | ||
== WORKAROUND == | == WORKAROUND == | ||
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code | 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.<br /> | ||
<br /> | <br /> | ||
To prevent the error message from occurring, terminate each DDE conversation after you are finished using the channel. To terminate a DDE channel, use either of the following WordBasic commands: | To prevent the error message from occurring, terminate each DDE conversation after you are finished using the channel. To terminate a DDE channel, use either of the following WordBasic commands: | ||
Line 65: | Line 65: | ||
<pre class="CODESAMP"> Sub Main | <pre class="CODESAMP"> Sub Main | ||
For x = 1 to 40 | For x = 1 to 40 | ||
chan = DDEInitiate( | chan = DDEInitiate("Excel", "Sheet1") | ||
'Your other commands go here | 'Your other commands go here | ||
DDETerminate chan | DDETerminate chan | ||
Next x | Next x | ||
End Sub </pre> | End Sub </pre> | ||
To reproduce the | To reproduce the "Session too complex...." error message, open Word and Excel and run a macro that opens a number of DDE channels without terminating the channels. | ||
<pre class="CODESAMP"> Sub Main | <pre class="CODESAMP"> Sub Main | ||
For x = 1 to 40 | For x = 1 to 40 | ||
n = DDEInitiate( | n = DDEInitiate("Excel","Sheet1") | ||
Next x | Next x | ||
End Sub </pre> | End Sub </pre> | ||
Line 82: | Line 82: | ||
== REFERENCES == | == REFERENCES == | ||
"Using WordBasic" by Wextech and Microsoft, pages 171, 172 | |||
Additional query words: channel dynamic data exchange | Additional query words: channel dynamic data exchange |
Revision as of 09:24, 20 July 2020
WD: DDE Error: Session Too Complex. Please Close a Window. |
Q102018
The information in this article applies to:
- Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
- Microsoft Word for Windows, versions 7.0, 7.0a
SYMPTOMS
If Microsoft Word or another application cannot open any additional dynamic data exchange (DDE) channels, the following message may be displayed:
=== Word 6.0, 7.0 in the following sequence ===
Too Many DDE Channels are open please close a window.
Cannot access remote Data (topic) Do you want to start the application <application>? Error 500: Cannot initiate link.Word 2.0x
Session too complex. Please close a window.
In order to open another DDE channel, a previous DDE channel must be closed.
CAUSE
When using DDE to communicate between applications, a separate "channel" or line of communication for each DDE conversation is created. It is possible to have multiple DDE conversations happening at the same time. While there is no absolute limit to the number of DDE conversations that can exist simultaneously, there is a relative limit that depends on the amount of system resources available. This limit will vary from system to system.
WORKAROUND
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.
To prevent the error message from occurring, terminate each DDE conversation after you are finished using the channel. To terminate a DDE channel, use either of the following WordBasic commands:
=== Syntax to terminate a specific channel number ===
DDETerminate(ChannelNumber) -or-
Syntax to terminate all DDE channels
DDETerminateAll
For example, the following macro uses DDETerminate to close each DDE channel that is initiated.
Sub Main For x = 1 to 40 chan = DDEInitiate("Excel", "Sheet1") 'Your other commands go here DDETerminate chan Next x End Sub
To reproduce the "Session too complex...." error message, open Word and Excel and run a macro that opens a number of DDE channels without terminating the channels.
Sub Main For x = 1 to 40 n = DDEInitiate("Excel","Sheet1") Next x End Sub
REFERENCES
"Using WordBasic" by Wextech and Microsoft, pages 171, 172
Additional query words: channel dynamic data exchange
Keywords : kbwordvba
Issue type :
Technology :
Last Reviewed: November 4, 2000 |