限制 Excel 文件以任何其他格式打开

发布于 2024-07-10 21:39:20 字数 109 浏览 4 评论 0原文

我想知道我有一个 18 页的 Excel 文件,应该用任何其他版本打开它。

例如,如果我右键单击该文件并选择使用 Open Office 打开,则会打开相同的文件。 我想锁定这个。

I would like to know that i have an excel file with 18 sheets and it should be opend with any other versions.

for example if i right click on the file and select open with open office the same is being opened. i would like to lock this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初与友歌 2024-07-17 21:39:20

不可能。
用户或操作系统决定调用哪些程序。

你能做的最好的事情就是混淆数据的读取,除非使用正确的程序。

not possible.
The user or OS decides which programs to invoke.

The best you can do is to obfuscate the data from being read, except with the correct program.

故人的歌 2024-07-17 21:39:20

这并不完全正确。 您可以创建一个与 Workbook_Open 事件关联的宏,该事件检查正在使用的 Excel 版本(即 Application.Version)。 例如,您可以尝试执行如下操作:

Private Sub Workbook_Open()
    If Int(Application.Version) <> 11 Then 
       Workbook.Saved = True
       Workbook.Close
    End If
End Sub

但是,如果用户禁用了宏,则此操作将不起作用,而且我也不知道它是否适用于 OpenOffice。 我确实知道 OpenOffice 有一个等效的 VBA,但对对象模型了解不够,无法判断 Excel 宏在 OpenOffice 中的行为是否完全相同。

我怀疑最好的选择是使用密码保护您的工作簿,并包含一个宏来检查正在使用的版本。 这不是一个万无一失的方法,但可能是您能得到的最接近的方法。

That's not strictly correct. You could create a macro that is tied to the Workbook_Open event that checks to see which version of Excel is being used (i.e. Application.Version). For example, you could try doing something like the following:

Private Sub Workbook_Open()
    If Int(Application.Version) <> 11 Then 
       Workbook.Saved = True
       Workbook.Close
    End If
End Sub

However, this won't work if users have macros disabled and I have no idea whether it would work on OpenOffice either. I do know that OpenOffice has a VBA equivalent, but don't know enough about the object models to say whether an Excel macro will behave the exact same way in OpenOffice.

I suspect that the best option is to password-protect your workbook and include a macro that checks to see which version is being used. Not a fool-proof approach but probably the closest you're going to get.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文