XL: Named Arguments Are Not Supported with DAOID: Q143453
|
When you run a Microsoft Excel Visual Basic for Applications macro that uses Data Access Objects (DAO), you may receive one of the following error messages:
Compile Error:
Named Argument Not Found
-or-
Run-time error '438':
Object doesn't support this property or method
DAO versions 3.0 and 3.5, which are included with Microsoft Excel 7.0 and
97 respectively, do not fully support named arguments. In some cases, named
arguments will work without error, however, you should avoid using them.
This behavior is by design of Microsoft Excel.
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://support.microsoft.com/support/To work around this behavior, use positional arguments instead of named arguments.
Set <database> = OpenDatabase(dbname, options, readonly, connect)
If you use the OpenDatabase method by supplying named arguments in the
macro, you may receive one of the errors described in this article. For
example, when you run the following macro, the compile error "Named
Argument Not Found" appears:
Set DB = _
OpenDatabase(dbname:= "C:\My Documents\DB1.MDB", readonly: = True)
Set DB = OpenDatabase("C:\My Documents\DB1.MDB", , True)
For more information about named arguments, click the Index tab in Visual Basic for Applications Help, type the following text
named argumentsclick the Display button, and then double-click the "Understanding Named Arguments and Optional Arguments" topic.
Additional query words: XL97 8.0 8.00 parameter OpenRecordset
Keywords : kberrmsg kbprg kbdta kbdtacode xldao KbVBA xlvbmigrate
Version : WINDOWS:7.0,7.0a,97
Platform : WINDOWS
Issue type :
Last Reviewed: July 1, 1999