N
NetWave128
Sub AddDocumentation()
Dim MyShape As Object
On Error GoTo ErrorHandler
Set MyShape
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 400, 200
400, 200)
MyShape.TextFrame.Characters.Text = "<Text Box Please Type Text Here>"
MyShape.TextFrame.Characters.Font.Name = "Arial"
MyShape.TextFrame.Characters.Text.Font.Size = 12
'the part below is what doesn't work
MyRange.Fill.ForeColor.SchemeColor = 43
MyShape.Fill.Visible = msoTrue
MyShape.Fill.Solid
MyShape.Shadow.Type = msoShadow14
Set MyShape = Nothing
Exit Sub '<-- if everything runs error-free, you will exit here
BEFORE the error handler.
ErrorHandler:
MsgBox "Sorry, an error occurred." & vbCrLf & "Number: " & Err.Numbe
& vbCrLf & "Description: " & Err.Description, vbCritical, "Error"
End Su
Dim MyShape As Object
On Error GoTo ErrorHandler
Set MyShape
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 400, 200
400, 200)
MyShape.TextFrame.Characters.Text = "<Text Box Please Type Text Here>"
MyShape.TextFrame.Characters.Font.Name = "Arial"
MyShape.TextFrame.Characters.Text.Font.Size = 12
'the part below is what doesn't work
MyRange.Fill.ForeColor.SchemeColor = 43
MyShape.Fill.Visible = msoTrue
MyShape.Fill.Solid
MyShape.Shadow.Type = msoShadow14
Set MyShape = Nothing
Exit Sub '<-- if everything runs error-free, you will exit here
BEFORE the error handler.
ErrorHandler:
MsgBox "Sorry, an error occurred." & vbCrLf & "Number: " & Err.Numbe
& vbCrLf & "Description: " & Err.Description, vbCritical, "Error"
End Su