The information in this article applies to:
SYMPTOMS
When you use the CustomDocumentProperties property to return the value of a
linked custom property in your file, the incorrect value may be returned.
CAUSE
This behavior occurs if you use the CustomDocumentProperties property to
set the value of a linked custom property and you have not displayed the
Properties dialog box in this file.
WORKAROUNDSTo work around this behavior when you create a custom linked property using the CustomDocumentProperties property, use any of the following methods: Method 1(Microsoft Excel only) Programmatically display, then dismiss, the Properties dialog box in your Visual Basic procedure before you access the value of one of the custom linked properties in your file. For example, you can use a macro similar to the following to accomplish this.Microsoft provides examples of Visual Basic 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. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose. Note that a line that is preceded by an apostrophe introduces a comment in the code--comments are provided to explain what the code is doing at a particular point in the procedure. Note also that an underscore character (_) indicates that code continues from one line to the next. You can type lines that contain this character as one logical line or you can divide the lines of code and include the line- continuation character. For more information about Visual Basic for Applications programming style, see the "Programming Style in This Manual" section in the "Document Conventions" section of the "Visual Basic User's Guide." Note that you must create a reference in your module to the Microsoft Office 95 Object Library using the References dialog box before you run the following code.
Method 2Display the Properties dialog box by clicking Properties on the File menu after creating the custom linked property and before accessing the value of the linked property in a Visual Basic macro.STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATIONYou can use the Properties dialog box to create a custom property in your application. To link a custom property to specific content in a Microsoft Excel file, you must define a name in your workbook. The Link To Content check box is available only if you have a defined name in your workbook. REFERENCESFor more information about using the CustomDocumentProperties Property in Microsoft Excel, click the Index tab in Microsoft Excel Help, type the following text CustomDocumentPropertiesdouble-click the selected text and then double-click "CustomDocumentProperties Property" to go to the "CustomDocumentProperties Property" topic. Additional query words:
Keywords : |
Last Reviewed: October 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |