K
Klemen25
Hello all
I formed the following macro to add green empty comment:
But the line ActiveCell.Comment.Shape.Select is not ok and I get
error:
Method "select" of the object "shape" failed.
Any soluions
Thank you!
Sub comment2()
Dim cmt As comment
Set cmt = ActiveCell.comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
ActiveCell.Comment.Shape.Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 42
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
End If
SendKeys "%i{DOWN}e~"
End Sub
I formed the following macro to add green empty comment:
But the line ActiveCell.Comment.Shape.Select is not ok and I get
error:
Method "select" of the object "shape" failed.
Any soluions
Thank you!
Sub comment2()
Dim cmt As comment
Set cmt = ActiveCell.comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
ActiveCell.Comment.Shape.Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 42
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
End If
SendKeys "%i{DOWN}e~"
End Sub