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.
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.
这并不完全正确。您可以创建一个与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 中的行为方式是否完全相同。
我怀疑最好的选择是用密码保护您的工作簿并包含一个宏来检查正在使用的版本。不是万无一失的方法,但可能是您将获得的最接近的方法。
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.