英文:
How to disable 'save' option in Excel but 'save as'
问题
Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)
MsgBox "无法保存此工作簿!"
Cancel = True
End Sub
当我们使用这个命令来禁止在Excel工作表中保存时,隐藏的工作表会从用户视图中显示出来。我该如何解决这个问题?
英文:
Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)
MsgBox "You can't save this workbook!"
Cancel = True
End Sub
When we use this command to disable saving in Excel sheets that we have hidden, they are displayed from the user's view. How can I solve this problem?
答案1
得分: 1
禁用保存功能,但允许另存为,请尝试以下方法...
Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)
If SaveUI = False Then
MsgBox "无法保存此工作簿!"
Cancel = True
End If
End Sub
英文:
To disable Save, but allow SaveAs, try the following...
Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)
If SaveUI = False Then
MsgBox "You can't save this workbook!"
Cancel = True
End If
End Sub
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论