以下是引用yigepure在2004-10-15 19:25:00的发言:
从今天中午到现在一直困惑的问题.
还有兰老师你什么时候能讲讲你的经典之作.伪正规软件的权限设置和密码登陆
Private Sub workbook_beforeclose(ByVal sh As Object, c As Integer)
Dim b As Integer
b = Worksheets.Count
For c= 2 To b
Sheets(a).Visible = False
Next c
End Sub
1、这里的错误是绿色部分,去掉就可以了,因为事件程序中的变量是系统自带的不能修改和添加,还有你用C循环,却用Sheets(a).Visible = False应该是Sheets(C).Visible = False
正确的程序应该是
Private Sub workbook_beforeclose(ByVal sh As Object)
Dim b As Integer
b = Worksheets.Count
For c= 2 To b
Sheets(C).Visible = False
Next c
End Sub
|