Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


Resolution

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

↑ Back to the top


Status

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

↑ Back to the top


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

  1. 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
  2. Run Excel 2000, and the press ALT+F11 to open the Microsoft Visual Basic for Applications (VBA) Editor.
  3. 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
  4. Leave Excel running, and then open Microsoft Word 2000 or another VBA host application. Press ALT+F11 to open the VBA Editor for Word.
  5. In the code window for ThisDocument, add the following code:
    Public Sub Test()
       Dim chan As Long
       AppActivate "Microsoft Excel"
       chan = DDEInitiate(App:="Excel", Topic:="System")
       DDEExecute chan, "[RUN(""'MyMacro """"Hello from DDE.""""'"")]"
       DDETerminate chan
    End Sub
  6. 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.
  7. 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.

↑ Back to the top


Keywords: KB821137, kbfix, kboffice2000presp4fix, kbbug, kbqfe

↑ Back to the top

Article Info
Article ID : 821137
Revision : 5
Created on : 4/7/2006
Published on : 4/7/2006
Exists online : False
Views : 220