Microsoft KB Archive/110310

From BetaArchive Wiki
Knowledge Base


Article ID: 110310

Article Last Modified on 10/11/2006



APPLIES TO

  • Microsoft Excel 95a
  • Microsoft Excel 5.0c
  • Microsoft Excel 5.0a for Macintosh



This article was previously published under Q110310

SYMPTOMS

When you record a Microsoft Visual Basic Programming System, Applications Edition macro command, and the ExecuteExcel4Macro method is recorded, you may receive a syntax error when you run the macro.

CAUSE

A few commands in Microsoft Excel must be recorded using the ExecuteExcel4Macro method because there is no equivalent command in Visual Basic. If the recorded command uses the ExecuteExcel4Macro method, the command may be placed onto two or more physical lines using the line continuation character (_).

For example, the following command is recorded when you change the update option for a link to Manual by clicking Links on the Edit menu:

   ExecuteExcel4Macro "SET.UPDATE.STATUS( _

           ""Word.Document.6|Document2!!DDE_LINK1"",2,2)"
                

This command will cause a syntax error when you run the macro because the ExecuteExcel4Macro argument is split across lines. Because the ExecuteExcel4Macro argument is a string, it must be contained all on one line.

WORKAROUND

When you use the ExecuteExcel4Macro command, type the command all on one line. If you record a macro, and a line continuation character is incorrectly inserted in the ExecuteExcel4Macro command, delete any line continuation characters in the command so that the command is all on one line.

STATUS

Microsoft has confirmed this to be a problem in the versions of Microsoft Excel listed at the beginning of this article. This problem was corrected in Microsoft Excel 97 for Windows and Microsoft Excel 98 Macintosh Edition.

NOTE: In all versions of Microsoft Excel, commands that follow the ExecuteExcel4Macro command must always be on a single line.

REFERENCES

For more information about the ExecuteExcel4Macro Method, choose the Search button in Help and type:

Excel 4.0: macro sheets



Additional query words: 5.00a 5.00c 7.00a XL7 XL5 XL

Keywords: kbbug kbprogramming KB110310