View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Cell comment string trunckating

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.)

Jose wrote:

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


--

Dave Peterson