XL5: Run Time Error with QueryGetData or QueryGetDataDialog

Last reviewed: September 12, 1996
Article ID: Q136315
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0

SYMPTOMS

In Microsoft Excel, you may receive the following error message if you run a macro that uses either the QueryGetData or the QueryGetDataDialog in Microsoft Excel version 5.0:

   Run-time error '1003'
   "Invalid Number of Arguments"

These XLQUERY.XLA add-in functions

CAUSE

In Microsoft Excel 5.0, there was not an option to save your password with a query when using "Get External Data" from the Data menu. This feature was added in Microsoft Excel version 5.0c. Likewise, in Microsoft Excel version 5.0c, the XLQUERY.XLA add-in functions QueryGetData and QueryGetDataDialog acquired an additional argument called "KeepPassword" to determine whether or not the password should be saved with the query in your workbook.

MORE INFORMATION

The syntax for these functions in Microsoft Excel versions 5.0 is:

   QueryGetData(ConnectionStr, QueryText, KeepQueryDef, FieldNames,
       RowNumbers, Destination, Execute)

   QueryGetDataDialog(ConnectionStr, QueryText, KeepQueryDef, FieldNames,
       RowNumbers, Destination, Execute)

The syntax for these functions in Microsoft Excel version 5.0c is:

   QueryGetData(ConnectionStr, QueryText, KeepQueryDef, FieldNames,
       RowNumbers, Destination, Execute, KeepPassword)

   QueryGetDataDialog(ConnectionStr, QueryText, KeepQueryDef, FieldNames,
       RowNumbers, Destination, Execute, KeepPassword)

If you run a macro that uses the eighth argument ("KeepPassword") in Microsoft Excel 5.0 (not the "c" release), you may receive the error message "Invalid Number of Arguments" when the macro is run. You will not receive this error in Microsoft Excel 5.0c.

REFERENCES

For additional information, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q118754
   TITLE     : XL5: No Option to Save/Not Save Password with MSQuery Add-in


KBCategory: kbtool
KBSubcategory:

Additional reference words: 5.00c addin



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.