I have never had this problem before, has anyone else?
This code adds a text box to a certain sheet and writes text in it:
Sheets(1).Select
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 0, _
0, 320#, 180#).Select
With Selection
.Characters.Text = "No " & constituent & " Data" 'ERROR ON THIS LINE
.HorizontalAlignment = xlCenter
End With
This is the error I get:
run-time error 438, object doesn't support this variable or method
When the error occurs, the text box is placed correctly and selected.
The strange thing is, the code works fine most of the time. I can't find any rhyme or reason as to why it works sometimes and not others. Any ideas?
This code adds a text box to a certain sheet and writes text in it:
Sheets(1).Select
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 0, _
0, 320#, 180#).Select
With Selection
.Characters.Text = "No " & constituent & " Data" 'ERROR ON THIS LINE
.HorizontalAlignment = xlCenter
End With
This is the error I get:
run-time error 438, object doesn't support this variable or method
When the error occurs, the text box is placed correctly and selected.
The strange thing is, the code works fine most of the time. I can't find any rhyme or reason as to why it works sometimes and not others. Any ideas?