View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ditto Ditto is offline
external usenet poster
 
Posts: 4
Default Please Help Error 400 when running tested code

The code I have tried to use is:

Sub Comments_AutoSize()
'posted by Dana DeLouis 2000-09-16
Dim MyComments As Comment
Dim lArea As Long
For Each MyComments In ActiveSheet.Comments
With MyComments
.Shape.TextFrame.AutoSize = True
If .Shape.Width 300 Then
lArea = .Shape.Width * .Shape.Height
.Shape.Width = 200
' An adjustment factor of 1.1 seems to work ok.
.Shape.Height = (lArea / 200) * 1.1
End If
End With
Next ' comment
End Sub

I was hoping that this would take all the comments in the worksheet and
resize them the same, however I get an error 400 message each time, without
any effect on the comments.

"JLatham" wrote:

One place to start is to post the code you are using and give us more
information about the problem you have encountered with the one particular
sheet. Also, explain what YOU expect the code to do.

"Ditto" wrote:

I have a large complex spreadsheet with 100's of comments that have
'spontaneously' taken on a variety of shapes and sizes. I applied VB code
(per Debra Dagleish) but get an Error 400 message when applied to this
spreadsheet. I have successfully applied the same macro to other
spreadsheets. Can someone help me identify the cause and implement a solution?