The information in this article applies to:
SYMPTOMS
When you run a Visual Basic macro that uses the Value property to return
the value of a built-in document property, you may receive an error
message.
With Microsoft Excel 97, you may receive the following error message.
CAUSE
This problem may occur when you use the BuiltinDocumentProperties property
to return the value of a property if the property does not contain a value.
Microsoft Office Visual Basic Help states that if the application doesn't
define a value for one of the built-in document properties, reading the
Value property for that document property causes an error.
The following is the list of built-in properties accessible through the BuiltinDocumentProperties property: Title WORKAROUND
To work around this problem, use the following example macro in Microsoft
Excel to detect if the value for a built-in document property has been set
and trap the run-time error. This macro loops through every built-in
property and displays a dialog box with the name of the property on the
first line, and the value of the property on the second line. If the
property has not been set, the message "Not Set" is displayed instead of
the value for that property.
Microsoft provides examples of Visual Basic for Applications procedures 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. The Visual Basic procedures in this article are
provided 'as is' and Microsoft does not guarantee that they can be used in
all situations. While Microsoft Support professionals can help explain the
functionality of a particular macro, they will not modify these examples to
provide added functionality, nor will they help you construct macros to
meet your specific needs. If you have limited programming experience, you
may want to consult one of the Microsoft Solution Providers. Solution
Providers offer a wide range of fee-based services, including creating
custom macros. For more information about Microsoft Solution Providers,
call Microsoft Customer Information Service at (800) 426-9400.
Note that to use this example macro in Microsoft Project, change the
following statement in the macro:
to the following:
REFERENCESFor more information about using the BuiltinDocumentProperties property in Microsoft Excel, click the Index tab in Microsoft Excel Help, type the following text BuiltinDocumentPropertiesdouble-click the selected text and then double-click "BuiltinDocumentProperties Property" to go to the "BuiltinDocumentProperties Property" topic. Additional query words: 7.0a xl97 built-in document properties
Keywords : |
Last Reviewed: October 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |