Microsoft KB Archive/186110

= XL98: Run-time Error 5 Using Example MacScript Code =

Article ID: 186110

Article Last Modified on 9/11/2002

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q186110



SYMPTOMS
When you use the example macro code provided in the MacScript Function Help topic, you may receive the following error:

Run-time error '5'

Invalid procedure call or argument



CAUSE
You receive this error because the example macro code is incorrect.



RESOLUTION
The example macro code provided in the MacScript Function Help topic is as follows: ThePath$ = Macscript("ChooseFile") In order to get this example code to run successfully, change it as follows: ThePath$ = Macscript("Choose File") Note that the only difference is the space between "Choose" and "File."

When you run your macro with this change, the Choose File script will return the name of the selected item to the variable called ThePath$ as a string.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Excel 98 Macintosh Edition.



MORE INFORMATION
The example macro code included with the MacScript Function Help topic incorrectly references a script called ChooseFile. The correct name for this script is Choose File and is located in the :System Folder:Scripting Additions folder. The scripts included in this folder are installed by your Apple Macintosh System software.

The third-party products discussed here are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.

