代码在我单步执行时工作,但在宏运行时不工作

时间:2017-12-13 22:40:38

标签: excel vba excel-vba

Sub ShowTestScript()

ActiveWorkbook.Unprotect
CCBEdit.Hide

wsTestScript.Visible = True
wsTestScript.Activate
wsTestScript.Range("A4:B25").Locked = False
wsTestScript.Range("B1").Value = CCBEdit.cboCtrlNum.Value

Query_Run "select stepno, steptext from testscripts where control = '" & CCBEdit.cboCtrlNum.Value & "'"
Query_Paste wsTestScript, "A4"
FormatRows wsTestScript.Range("A4", "B25")

ActiveWorkbook.Protect
End Sub

我的问题是解锁细胞。单步执行时,单元格在wsTestScript上解锁,但是当我运行宏时,它们被锁定。

0 个答案:

没有答案