excel提示57121 应用程序定义或对象定义错误 附出错代码
PrivateSubWorkbook_BeforeClose(CancelAsBoolean)ActiveWorkbook.UnprotectPassword:="123...
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Unprotect Password:="12345"
Sheets("A").Visible = True
Sheets("A").Activate
For a = 1 To Sheets.Count
If Sheets(j).Name <> "A" Then
Sheets(j).Visible = False
End If
Next j
ActiveWorkbook.Protect Password:="12345"
End Sub
此代码中
If Sheets(a).Name <> "A" Then 显示出错 打开表就出错
请老师们给解决下 展开
ActiveWorkbook.Unprotect Password:="12345"
Sheets("A").Visible = True
Sheets("A").Activate
For a = 1 To Sheets.Count
If Sheets(j).Name <> "A" Then
Sheets(j).Visible = False
End If
Next j
ActiveWorkbook.Protect Password:="12345"
End Sub
此代码中
If Sheets(a).Name <> "A" Then 显示出错 打开表就出错
请老师们给解决下 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
2个回答
展开全部
excel 的问题。
换成:
for each sh in sheets
if sh.name<>"a" then
sh.visible =false
end if
next
换成:
for each sh in sheets
if sh.name<>"a" then
sh.visible =false
end if
next
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询