The information in this article applies to:
SUMMARYMicrosoft Excel allows you to create custom functions using Visual Basic for Applications. You can also use Data Access Objects (DAO) to programmatically return information from an external database. This article includes sample macro code that uses DAO to return an array of data to a custom worksheet function. MORE INFORMATIONMicrosoft 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.aspThe following sample macro assumes you installed the Data Access Objects component of Microsoft Office and the Northwind database files (Customer.dbf, Employee.dbf, and Orders.dbf) on your computer. NOTE: By default, the Northwind database files are installed in the Program Files\Microsoft Office\Office folder. To use the example macro, follow these steps:
NOTE: If the function returns more data than the range of cells can contain, the data is cut off; that is, the range does not expand to hold the returned data. If the range of cells is too large, cells that do not contain any data display the #N/A error value. REFERENCES
For more information about using Data Access Objects, click the Office
Assistant, type DAO, click Search, and then
click to view "Data Access Objects Overview."
Q120802 Office: How to Add/Remove a Single Office Program or Component Additional query words: XL97
Keywords : kbprg kbdta kbdtacode KbVBA kbhowto |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |