LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default VBA to edit a comment

Good morning,

I am using Windows XP; Office 2002 SP2.
i am trying to put together some code that will:
A. Create a comment in the current cell (without naming the cell by range)
B. Enter the folling text double spaced and bolded
Analysis:
Result:
Reviewers:
C. And size the comment box to a specific size.

I recorded a macro as I performed these operations and got the following
code. (I replaced the cell range references w/ "Activecell" to make the cell
selection more dynamic.)

This is the code from Excel:
Sub Notes()
'
' Notes Macro
' Macro recorded 11/5/2007 by DD065C
'

'
ActiveCell.Select
ActiveCell.AddComment
ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Text:= _
"DD065C:" & Chr(10) & "" & Chr(10) & "Analysis: " & Chr(10) & "" &
Chr(10) & "Result: " & Chr(10) & "" & Chr(10) & "Reviewers: "
'Selection.ShapeRange.ScaleWidth 1.8, msoFalse, msoScaleFromTopLeft
'Selection.ShapeRange.ScaleHeight 3.41, msoFalse, msoScaleFromTopLeft
'ActiveCell.Comment.Shape.Select True
ActiveCell.Comment.Text Text:= _
"DD065C:" & Chr(10) & "" & Chr(10) & "Analysis: " & Chr(10) & "" &
Chr(10) & "Result: " & Chr(10) & "" & Chr(10) & "Reviewers: "
End Sub

When I run the macro on a new cell, everything works except the lines I have
commented out:
'Selection.ShapeRange.ScaleWidth 1.8, msoFalse, msoScaleFromTopLeft
'Selection.ShapeRange.ScaleHeight 3.41, msoFalse, msoScaleFromTopLeft
'ActiveCell.Comment.Shape.Select True

These always trigger a debug error stating:
Runtime Error '438'. Object does not support this object or method.

Does anybody know why this is occuring and can recommend a correction?

Thanks,
Brent


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit comment in cell Liz Excel Discussion (Misc queries) 1 August 17th 06 02:15 AM
Comment box appears many rows away when trying to edit Kamran Excel Discussion (Misc queries) 2 April 4th 06 03:27 PM
Comment box appears many rows away when trying to edit Kamran Excel Discussion (Misc queries) 2 March 28th 06 11:24 PM
How can I edit a comment w/o first having to select Show Comment Mary Ann Excel Discussion (Misc queries) 1 August 26th 05 12:34 AM
cannot edit comment deo89 Excel Discussion (Misc queries) 4 August 24th 05 05:20 PM


All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"