Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Watermark/Shape

Status
Not open for further replies.

mar050703

Technical User
Aug 3, 2007
99
GB
Hi All

I am trying to code an excel sheet whereby the code will add a watermark/shape, save the document, and then I need it to remove the watermark/shape.

So far I have the following code to add the watermark/shape
Code:
With ActiveSheet.Shapes.AddTextEffect(msoTextEffect1, "Draft", _
        "Arial Black", 72#, msoFalse, msoFalse, _
        10, 10)
    .ScaleWidth 1, msoFalse, msoScaleFromTopLeft
    .ScaleHeight 1, msoFalse, msoScaleFromBottomRight
    .Fill.Visible = msoFalse
    .Fill.Solid
    .Fill.ForeColor.SchemeColor = 26
    .Fill.Transparency = 0.9
    .Shadow.Transparency = 0.4
    .Line.Visible = msoFalse
    .Top = 200
    .Left = 100
    .ZOrder msoSendToBack
End With

However I am unable to remove it, I thought this would do it:

Code:
Activesheets.Shapes("Draft").Select
Selection.Cut

I keep getting a runtime error 424, object required error. I guess I am missing something obvious, any suggestions?

Thanks
 
Solved my problem.

The issue was that the name was not being defined.

Therefore at the bottom of the adding the shape I used:
Code:
 .Name = "Draft"

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top