Cell comment string trunckating

  • Thread starter Thread starter Jose
  • Start date Start date
J

Jose

Hi,

Has anybody been able to read a comment of 600+
characters. I have not found any documentations saying
that this is not possible, but my strings trunckate at
random lengths.

Dim txt as string
txt = String(600," ")
txt = cells(1,1).comment.text()

The comment in cell(1,1) is very long, but it trunckates.
I am using Excel 2002 SP3. Anyone familiar with this
problem.

Thanks for the help.

Jose
 
This worked for me in xl2002:

Option Explicit
Sub testme01()

Dim myStr1 As String
Dim myStr2 As String

myStr1 = Application.Rept("asdf ", 1200)
MsgBox Len(myStr1)

With ActiveCell
If .Comment Is Nothing Then
'do nothing
Else
.Comment.Delete
End If
.AddComment Text:=myStr1
myStr2 = .Comment.Text
MsgBox Len(myStr2)
End With

End Sub

(I used 120*5=600 and it worked. I upped it to 1200 (1200*5) and it still
worked.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top