The information in this article applies to:
SUMMARYIn Microsoft Excel 98, the NoteText method of a cell is limited to a maximum length of 255 characters. This article explains how to work around this limitation and some of the related problems that you may encounter when you work with cell comments. 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.asp Working Around the 255-Character Limitation of the NoteText MethodAlthough the NoteText method of a cell is limited to a maximum of 255 characters, you can insert a comment that is up to 32,767 characters in length in a cell. To do this, use the Text method of a Comment object that is attached to the cell. For example, instead of the following code
use a line of code that is similar to the following:
Using the NoteText Method with Comments Longer Than 255 CharactersIf you use the NoteText method to insert a comment that is longer than 255 characters in length in a cell, the new comment is not inserted in the cell, and you do not receive an error message.For example, if you run a macro with the following code
and the active cell does not already contain a comment, no comment is added
to the cell because the length of the new comment would exceed 255
characters.
If you run a macro with the following code
and the length of the existing comment exceeds 155 characters, the comment
is not updated because the length of the new comment would exceed 255
characters.
NOTE: In earlier versions of Microsoft Excel, the first 255 characters of text are applied to the comment; the remaining characters are truncated. Using Comment.Text to Change the Comment in a CellWhen you use Comment.Text to change the comment in a cell, the cell must already contain a comment. If no comment was previously inserted in the cell, you receive the following error message:To insert a comment in a cell, use code similar to the following:
NOTE: If the active cell already contains a comment, you receive the
following error message when you run the code:
To add a comment to a cell that may or may not contain a comment, use code similar to the following:
Using Comment.Text to Add New Text to an Existing CommentIf you want to add new text to an existing comment while preserving the original comment text, use a line of code similar to the following:
Characters over the 32,767-character limit for comments are truncated.
REFERENCES
For more information about the NoteText Method, click the Office Assistant,
type NoteText, click Search, and then click to view "NoteText Method."
Q179216 OFF98: How to Use the Microsoft Office Installer Program Additional query words: 32767 XL98
Keywords : kbcode kbdtacode xlvbahowto xlvbainfo |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |