Results 1 to 8 of 8

Cell Comment Truncating String?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-09-2009
    Location
    Cedar Hill, Tx
    MS-Off Ver
    Excel 2003
    Posts
    200

    Cell Comment Truncating String?

    I form a string and put that string into a selected cell as a comment. Mostly it works fine but as the string gets over a certain length (255 characters?), the string gets "truncated" in that only the characters over that length get put into the comment.

    Here's the code that I use:

    Public Sub getBellTimes()
        Dim cmnt As Comment
        Dim sStr As String
        sStr = "Bell Schedule" + Chr(10) + "    AM" + Chr(10)
    
    ...code to further develope the sStr value...
    
        MsgBox sStr
        MsgBox Len(sStr)
        ActiveSheet.Range("hold").AddComment (sStr)
        Set cmnt = ActiveSheet.Range("hold").Comment
        With cmnt.Shape.TextFrame
            .Characters.Text = ""
            .AutoSize = True
            .Characters.Text = sStr
        End With
    End Sub
    The sStr variable is correctly formed (as seen with the msgBox) prior to the time that I try to put it into the comment.

    Any ideas what I'm doing wrong?

    TIA.

    Bob
    Last edited by bstubbs; 06-11-2009 at 02:56 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1