Microsoft KB Archive/189895

= Macro with Find method results in compile error in Excel for Mac =

Article ID: 189895

Article Last Modified on 1/23/2007

-

APPLIES TO


 * Microsoft Excel 2004 for Mac
 * Microsoft Excel X for Mac
 * Microsoft Excel 2001 for Mac
 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q189895



SYMPTOMS
When you run a Visual Basic for Applications macro in Microsoft Excel for Mac, you receive the following error message:

Compile error:

Named argument not found



CAUSE
This problem may occur if the following conditions are true:
 * You used the macro recorder to create some or all of your Visual Basic macro.

-and-
 * You recorded a usage of the Find command on the Edit menu.



WORKAROUND
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.

To work around the problem, you need to change the syntax of the Find method in your Visual Basic macro. For example, the macro recorder may create a line of code that is similar to the following: Cells.Find What:="Test", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, Activate:=True You must change this line of code to the following: Cells.Find(What:="Test", After:=ActiveCell, LookIn:=xlFormulas, LookAt _     :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _      MatchCase:=False).Activate



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

Additional query words: MacXLX Mac XLX XL2001 XL98 XL vba automation automatic vb code

Keywords: kbbug kberrmsg kbpending KB189895

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.