Hi Guys,
I have a workbook that contains several sheets, and have been adding macros and code to it, and i must have changed something incorrectly somewhere because i had some shapes that i could click and they would run a macro and then change the text of the shape, but the code is failing at that point of trying to change the text of the shape. Here is the code for one of the shapes i was running, which did work, but now doesnt, i get "run-time error 1004: unable to set the text property of the characters class. Can someone help out with what could have happened?
I have a workbook that contains several sheets, and have been adding macros and code to it, and i must have changed something incorrectly somewhere because i had some shapes that i could click and they would run a macro and then change the text of the shape, but the code is failing at that point of trying to change the text of the shape. Here is the code for one of the shapes i was running, which did work, but now doesnt, i get "run-time error 1004: unable to set the text property of the characters class. Can someone help out with what could have happened?
VBA Code:
Sub All_Required_Info_Cell()
ActiveSheet.Unprotect
If Range("All_Required_Info_Cell").Value <> "Yes" Then
Range("All_Required_Info_Cell").Value = "Yes"
'This is where it is throwing the error, on the line below:
ActiveSheet.Shapes("All_Required_Info_Textbox").TextFrame.Characters.Text = "Mark as incomplete"
Else: Range("All_Required_Info_Cell").Value = "No"
ActiveSheet.Shapes("All_Required_Info_Textbox").TextFrame.Characters.Text = "Mark as complete"
End If
ActiveSheet.Protect
End Sub