XL98: Macro with Find Method Results in Compile Error

ID: Q189895


The information in this article applies to:
  • Microsoft Excel 98 Macintosh Edition


SYMPTOMS

When you run a Visual Basic for Applications macro in Microsoft Excel 98 Macintosh Edition, you may 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 using the Find command on the Edit menu.



WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
To work around the problem, you need to change the syntax used for the Find method in your Visual Basic macro. For example, the macro recorder may create a line of code similar to the following:

   Cells.Find What:="Test", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
      :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
      MatchCase:=False, Activate:=True 
You would need to 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 this to be a problem in Microsoft Excel 98 Macintosh Edition.

Additional query words: XL98

Keywords : kbdta xlformula
Version : MACINTOSH:98
Platform : MACINTOSH
Issue type : kbbug


Last Reviewed: February 1, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.