Microsoft KB Archive/821136

From BetaArchive Wiki

Article ID: 821136

Article Last Modified on 7/28/2006



APPLIES TO

  • Microsoft Excel 2002 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 the user updates to Service Pack 2. 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 the user did not have Macro Security 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 fail to work as expected. These clients may display an error message or may show strange behavior if they fail to run the macro.

RESOLUTION

A supported fix is now available from Microsoft, but it is only intended to correct the problem described in this article. Only apply it to systems that are experiencing this specific problem. This fix may receive additional testing to further ensure product quality. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Office XP service pack that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. After the hotfix is installed, the English version of this fix will have the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

   Date         Time      Size     File name
   ------------------------------------------
   17-May-2003  04:13  16,553,592  Excelff.msp
   17-May-2003  03:03   4,853,832  Excelop.msp
   17-May-2003  03:20       6,544  Readme.txt
                
The English version of this fix should have the
          following file attributes or later:
   Date         Time   Version          Size      File name
   --------------------------------------------------------
   16-May-2003  16:43  10.0.5313.0     9,177,672  Excel.exe
                

This fix is a post-Office XP Service Pack 2 (SP-2) fix. To install the fix, you must have Office XP SP-2 installed. For additional information about Office XP SP-2, click the following article number to see the article in the Microsoft Knowledge Base:

325671 OFFXP: Overview of the Office XP Service Pack 2


Additionally, you may have to install Windows Installer 2.0 to install this fix. For additional information about the Windows Installer requirement for post-Office XP SP-2 fixes, click the following article number to see the article in the Microsoft Knowledge Base:

330537 OFFXP: Office XP Updates and Patches Released After September 2002 May Require Windows Installer 2.0




STATUS

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

MORE INFORMATION

Service Pack Information

This problem was first corrected in Office XP Service Pack 3.To resolve this problem, obtain the latest service pack for Microsoft Office XP. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

307841 How to obtain the latest Office XP Service Pack


After the hotfix is applied, inline macro calls that are raised by trusted clients (DDE or Automation) now run as expected 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 that has been digitally signed and previously trusted (in High Security). DDE clients that add macros dynamically or that intend to run non-trusted macros without user interaction continue to be blocked as a potential security risk to the user.

Steps to Reproduce the Problem

  1. Install Excel 2002 Service Pack 2 as directed in the following Knowledge Base article:

    307841 OFFXP: How to Obtain the Latest Office XP Service Pack

  2. Run Excel 2002, and then 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 2002 (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 are prompted, 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.

    If the Macro Security level of Excel is set to Low, or if you install the hotfix that is mentioned in this article, you may receive the message that is raised by the Excel macro when it runs the DDE code.



Additional query words: kb2HR1

Keywords: kbbug kbfix kbqfe kbofficexppresp3fix kbhotfixserver KB821136