Article ID: 110462 - Last Review: October 10, 2006 - Revision: 2.2 ShowDataForm Method Fails If Data Can't Be FoundThis article was previously published under Q110462 On This PageSYMPTOMS
In Microsoft Excel, when you use the Visual Basic ShowDataForm method, you
may receive the following error message:
Run-time error '1004': ShowDataForm method of Worksheet class failed CAUSE
This error occurs because Microsoft Excel is unable to find a data list on
the worksheet you specified in the Visual Basic statement.
When you use the ShowDataForm method, Microsoft Excel looks for the data list in two places:
WORKAROUNDMicrosoft 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 this problem, define your data with the defined name
"database" or move your data so that its upper-left corner is located in
any of the four cells in the range A1:B2.
To define your data with the defined name "database"
To automate the above process, select the data that you want to be included in your database (including column headings), and include the following in your Visual Basic procedure: MORE INFORMATION
The Visual Basic ShowDataForm method is used to display a data form. You
can use a data form to view a list of data or to enter new data into a
list. You might use the ShowDataForm method in either of the following
ways:
REFERENCES
For additional information about getting help with Visual Basic for
Applications, please see the following article in the Microsoft Knowledge
Base:
163435
(http://support.microsoft.com/kb/163435/EN-US/
)
VBA: Programming Resources for Visual Basic for Applications
| Article Translations
|

Back to the top
