Microsoft KB Archive/184368

From BetaArchive Wiki

Article ID: 184368

Article Last Modified on 6/23/2005



APPLIES TO

  • Microsoft Excel 98 for Macintosh
  • Microsoft Word 98 for Macintosh
  • Microsoft PowerPoint 98 for Macintosh



This article was previously published under Q184368

SYMPTOMS

If you run a Visual Basic for Applications macro that displays a custom Microsoft Office Assistant balloon, the following problems may occur:

  • When you respond to the balloon by clicking OK in Microsoft Excel 98 Macintosh Edition, the Office Assistant displays a balloon that contains an error message similar to the following

    Microsoft Excel
    The macro '<Module1.YourCustomMacro>' cannot be found.

    where <Module1.YourCustomMacro> refers to your macro name. When you click OK, the custom Office Assistant balloon appears again.
  • When you click OK in Microsoft Word 98 Macintosh Edition or Microsoft PowerPoint 98 Macintosh Edition, the custom Office Assistant balloon remains on the screen regardless of the number of times you click OK.
  • If you display the Office Assistant again, and then attempt to close it, the custom Office Assistant balloon appears.


CAUSE

These problems may occur when the following conditions are true:

  • In the Visual Basic macro, you use the Callback property to set the name of a macro to run when a modeless custom Office Assistant balloon is displayed. -and-


  • You set the Callback property to refer to a nonexistent macro, or you incorrectly use the Callback property to refer to a macro that does exist. -and-


  • You run the Visual Basic macro, which then displays the custom Office Assistant balloon.


WORKAROUND

To prevent these problems from occurring, do the following:

  • Verify that you did not misspell the macro name that the Callback property refers to.


For example, if you set the Callback property to refer to a macro named "Hello," make sure that the Hello macro exists in a project for the document.

  • If the macro that the Callback property refers to is in a different module in the same document, add the module name to the beginning of the macro name.


For example, if you want the Callback property to refer to the macro named "Goodbye" in Module3, set the Callback property to Module3.Goodbye.

NOTE: This requirement does NOT apply to Microsoft Excel 98.

If one of these problems has occurred, quit and restart the program in which the problem occurs. After you do this, modify the Visual Basic for Applications code so that the Callback property refers to the correct macro name in a valid location.

NOTE: You can dismiss the Office Assistant window by clicking the Close box in the upper-left corner of the Office Assistant window while the custom Office Assistant balloon is displayed.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. In the Office 98 programs, you can create and display custom Office Assistant balloons. To do this, use Visual Basic for Applications macros that are similar to the following examples:

   ' Both macros are contained in the same module, Module1.
   Sub BalloonTest()

       Dim Bln As Balloon
       Set Bln = Assistant.NewBalloon
       With Bln
           .Heading = "Heading"
           .Text = "Some text."
           .Mode = msoModeModeless   ' Make the balloon modeless.
           .Callback = "Goodbye"     ' Run this macro when OK is clicked.
           .Show                     ' Display the balloon.
       End With

   End Sub

   Sub Goodbye(Bln As Balloon, iBtn As Long, iPriv As Long)
       Assistant.Animation = msoAnimationSearching
       MsgBox "Goodbye!"
       Bln.Close
   End Sub
                

When you run the BalloonTest Sub procedure, the Office Assistant window appears and displays the custom balloon. When you click OK in the balloon, the Goodbye Sub procedure runs and displays a message box. When you dismiss the message box, the Office Assistant balloon disappears. This behavior is correct.

If you set the Callback property so that it refers to a misspelled macro name or an incorrect location, the problem described in this article occurs.

NOTE: In Microsoft Word 98 and Microsoft PowerPoint 98, if you set the Callback property to refer to a macro that exists in another module, you must specify the module name before the macro name. For example, if you move the macro Goodbye to Module3, change the code to the following:

  .Callback = "Module3.Goodbye"
                

If you do not specify the module name, the problem occurs when you display the custom Office Assistant balloon. In Microsoft Excel 98, this is not required if the macro exists in the same workbook.

REFERENCES

For more information about customizing the Office Assistant, from the Visual Basic Editor, click the Office Assistant, type Office Assistant, click Search, and then click to view "Overview of the Office Assistant."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If the Assistant is not able to answer your query, please see the following article in the Microsoft Knowledge Base:

176476 OFF: Office Assistant Not Answering Visual Basic Questions



Additional query words: OFF98 XL98 WORD98 PPT98 go away disappear vanish xlvbahowto

Keywords: kbprogramming kbprb kbdtacode kbcode KB184368