Microsoft KB Archive/821137

= XL2000: DDE Clients Cannot Use a RUN Command to Run an Inline Macro After a Security Update =

Article ID: 821137

Article Last Modified on 4/7/2006

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition

-





SYMPTOMS
Client applications can use Dynamic Data Exchange (DDE) to issue a macro RUN command to Excel 2002. This command may stop working after you update to Service Pack 3 or the Security Update that is listed below. To the client application, the method call appears to succeed, but the macro does not run. This problem occurs if the DDE client uses an inline macro string and not a macro name in the RUN command.

Note The purpose of using an inline macro is to pass parameters to a macro.



CAUSE
Microsoft released a security update in June 2002 for all versions of Excel. This security update purposely blocked inline macro evaluations if you did not have the Macro Security level set to Low. For additional information about the security update, click the following article number to view the article in the Microsoft Knowledge Base:

324458 MS02-031: June 19, 2002 Cumulative Patches for Microsoft Excel and Microsoft Word

Because of the security update, DDE clients that use inline macro strings with the RUN command may not work as expected. These clients may display error messages or may show strange behavior if they cannot run the macro.



How to Obtain the Hotfix
This issue is fixed in the Excel 2000 Hotfix Package 1. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

822611 Availability of the Excel 2000 Post-Service Pack 3 Hotfix Package: June 7, 2003



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
After the hotfix is applied, inline macro calls that are raised by trusted DDE clients or Automation clients now run as you expect if the macro that is invoked is in a workbook that has been trusted by the user through a security prompt (in Medium Security) or has been digitally signed and previously trusted (in High Security). DDE clients that add macros dynamically or that intend to run macros that are not trusted without user interaction continue to be blocked as a potential security risk to the user.

Steps to Reproduce the Problem
 Install Excel 2000 Service Pack 3. For additional information about how to install Excel 2000 Service Pack 3, click the following article number to view the article in the Microsoft Knowledge Base:

326585 OFF2000: Overview of Office 2000 Service Pack 3

 Run Excel 2000, and the press ALT+F11 to open the Microsoft Visual Basic for Applications (VBA) Editor.  On the Insert menu, click Module to add a new code module. Add the following code to the module: Sub MyMacro(s As String) MsgBox s, vbMsgBoxSetForeground End Sub  Leave Excel running, and then open Microsoft Word 2000 or another VBA host application. Press ALT+F11 to open the VBA Editor for Word.  In the code window for ThisDocument, add the following code: Public Sub Test Dim chan As Long AppActivate &quot;Microsoft Excel&quot; chan = DDEInitiate(App:=&quot;Excel&quot;, Topic:=&quot;System&quot;) DDEExecute chan, &quot;[RUN(&quot;&quot;'MyMacro &quot;&quot;&quot;&quot;Hello from DDE.&quot;&quot;&quot;&quot;'&quot;&quot;)]&quot; DDETerminate chan End Sub </li> Press F5 to run the Word macro. If you receive a prompt, select ThisDocument.Test as the macro that you want to run. Notice that the Excel macro is never called if the Macro Security level of Excel is set to High or to Medium. No error is raised to indicate that the call failed.</li> If the Macro Security level of Excel is set to Low, or if you install the hotfix that is mentioned in this article, you can see the message box that is raised by the Excel macro when you run the DDE code.</li></ol>

Additional query words: KB3HR1

Keywords: kbbug kbfix kboffice2000presp4fix kbqfe kbhotfixserver KB821137

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.