我正在尝试关闭我的 excel 文档的自动保存功能(在 OneDrive 上保存文件时使用 Excel 365):
做一点研究AutoRecover.Enabled = False
( Application.
)应该是正确的属性,但由于某种原因我无法让它工作。我没有收到错误消息,但自动保存功能没有关闭。
不同的对象( myWorkbook.AutoRecover.Enabled = False
等)也没有运气。任何想法可能是什么问题?
最佳答案
此代码检查 Excel 365 中的自动保存是否已打开,如果是,则将其关闭。它显示指示更改前后状态的消息。
Note: The below code only works for office 365 subscribers and in Excel 2016 or later
Sub ChkAutoSv()
Dim AutoSv As Boolean
If Val(Application.Version) > 15 Then
AutoSv = ActiveWorkbook.AutoSaveOn
MsgBox "AutoSave set to: " & AutoSv
If AutoSv Then ActiveWorkbook.AutoSaveOn = False
AutoSv = ActiveWorkbook.AutoSaveOn
MsgBox "AutoSave now set to: " & AutoSv
End If
End Sub
关于excel - 在 vba (Excel/OneDrive) 中关闭自动保存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58161421/