Autosize textframe
If the only issue is with the sheet being protected, then try this.
Worksheets("sheetname").Unprotect
---your code here---
Worksheets("sheetname").Protect
--
Ian
--
"Jos Vens" wrote in message
...
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
|