这是我的代码,
If ActiveWorkbook.Sheets("About tool").Range("G1").Value = 1 Then
ActiveWorkbook.Sheets("About tool").Range("G1").Value = 0
With ActiveWorkbook.Sheets("About tool").Shapes("Rounded Rectangle 2").TextFrame2
If .HasText Then
.TextRange.Delete
.TextRange.Text = "Unlock All"
End If
End With
ElseIf ActiveWorkbook.Sheets("About tool").Range("G1").Value = 0 Then
ActiveWorkbook.Sheets("About this tool ").Range("G1").Value = 1
With ActiveWorkbook.Sheets("About tool").Shapes("Rounded Rectangle 2").TextFrame2
If .HasText Then
.TextRange.Delete
.TextRange.Text = "Lock All"
End If
End With
End If
在 ELSEIF 部分,我收到一条错误消息,提示“运行时错误 -2147024809 (80070057) 指定的值超出范围”。
它在 IF 部分运行良好。它是相同的代码,只是更改了作为文本传递的字符串。