Random placement of WordArt on worksheet

jbrouse

Active Member
Joined
Apr 28, 2005
Messages
329
Greetings!

Below is my code for printing 3 copies of a workbook, each "stamped" with a different label.

Code:
Sub Macro2()

    For i = 3 To 1 Step -1
    'On Error Resume Next
        For Each Sh In Worksheets
            If Sh.Name = "Sheet1" Then
                a = 400
                B = 575
                Sh.Select
            ElseIf Sh.Name = "Sheet2" Then
                a = 570
                B = 570
                Sh.Select
            End If
            For Each shape In ActiveSheet.Shapes
                If shape.Type = msoTextEffect Then
                    shape.Delete
                End If
            Next
            
            ActiveSheet.Shapes.AddTextEffect(msoTextEffect2, "DCS CONTROLLED 00" & i, "Haettenschweiler", 20#, msoTrue, msoFalse, a, B).Select
            Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10
            Selection.ShapeRange.Line.Visible = msoFalse
        Next
        ActiveWorkbook.PrintOut
    Next
End Sub

Sometimes, this code works. Most of the time, however, it will randomly place the WordArt somewhere on the worksheet, out of the print range. Can anyone please tell me why this is happening? It also prints it much larger than the 20 font I have set it to.

Any assistance would be greatly appreciated. Thanks!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Some more information I just discovered...

The WordArt is actually positioned in the same place everytime, and this problem only occurs on Sheet1. Like I mentioned, it's much larger than the size I have set for it. I have found that to make it the same size as the WordArt on Sheet2, I have to reduce the size of it from 0.66x1.9 to 0.11x0.3. Despite the fact that it is much larger and in the wrong position, the .Left, .Top, width, and height values are the same. This I do not understand, since both pages are set to 100% of their normal size.

As for the 'a' and 'B' values, currently, there are only 2 pages. I haven't added the rest yet.

Thanks for your help. Let me know if you can think of anything else.

Regards!
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top