View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jos Vens[_2_] Jos Vens[_2_] is offline
external usenet poster
 
Posts: 134
Default Autosize textframe

Hi,

I have a problem of autosizing my texframe of a comment (see code below)

I set reference to the cell I want to add comment, but if text is too long,
I can't see it because the rectangle which displays the comment is too
small. Since my sheet is protected, I cannot resize the frame. I use the
autosize-property to give the comment the right size, but somethimes (most
of the times when the textframe is to small) I does not work right,
sometimes, the frame fits the comment.

When I use the procedure in a new worksheet is does the job well. Can I set
the dimensions of the comment procedurally?

Thanks
Jos Vens

set vCell = ActiveCell
vComment = "Hi there, this text is so long it doesn't fit the rectangular
comment box"

vCell.AddComment vComment
vCell.Comment.Shape.TextFrame.AutoSize = True