在 Excel 2007 中隐藏工作表(使用密码)或在 Excel 中隐藏 VBA 代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4043468/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 10:54:13  来源:igfitidea点击:

Hiding a sheet in Excel 2007 (with a password) OR hide VBA code in Excel

excelvbaoffice-2007

提问by Jacob

I found a way to hide Excel sheets which is as follows: set the visibility of the sheet to VeryHidden in the VBAProject properties and then password protect VBAProject properties.

我找到了一种隐藏 Excel 工作表的方法,如下所示:在 VBAProject 属性中将工作表的可见性设置为非常隐藏,然后密码保护 VBAProject 属性。

This is great, but in Excel 2007, if you save it as XLSX, the VBAProject password protection is stripped and you can view the VBA code. Is there any way to prevent this?

这很好,但在 Excel 2007 中,如果将其另存为 XLSX,则 VBAProject 密码保护将被剥离,您可以查看 VBA 代码。有什么办法可以防止这种情况吗?

OR, is there any other way to hide an Excel 2007 sheet?

或者,有没有其他方法可以隐藏 Excel 2007 工作表?

回答by PowerUser

Here is what you do in Excel 2003:

以下是您在 Excel 2003 中执行的操作:

  1. In your sheet of interest, go to Format -> Sheet -> Hideand hide your sheet.
  2. Go to Tools -> Protection -> Protect Workbook, make sure Structureis selected, and enter your password of choice.
  1. 在您感兴趣的工作表中,转到格式 -> 工作表 -> 隐藏并隐藏您的工作表。
  2. 转到Tools -> Protection -> Protect Workbook,确保选择了Structure,然后输入您选择的密码。

Here is what you do in Excel 2007:

以下是您在 Excel 2007 中执行的操作:

  1. In your sheet of interest, go to Home ribbon -> Format -> Hide & Unhide -> Hide Sheetand hide your sheet.
  2. Go to Review ribbon -> Protect Workbook, make sure Structureis selected, and enter your password of choice.
  1. 在您感兴趣的工作表中,转到主页功能区 -> 格式 -> 隐藏和取消隐藏 -> 隐藏工作表并隐藏您的工作表。
  2. 转到Reviewribbon -> Protect Workbook,确保选择Structure,然后输入您选择的密码。

Once this is done, the sheet is hidden and cannot be unhidden without the password. Make sense?

完成此操作后,该工作表将被隐藏并且没有密码就无法取消隐藏。有道理?



If you really need to keep some calculations secret, try this: use Access (or another Excel workbook or some other DB of your choice) to calculate what you need calculated, and export only the "unclassified" results to your Excel workbook.

如果您确实需要对某些计算保密,请尝试以下操作:使用 Access(或其他 Excel 工作簿或您选择的其他数据库)来计算您需要计算的内容,并仅将“未分类”结果导出到您的 Excel 工作簿。

回答by BradC

No.

不。

If the user is sophisticated or determined enough to:

如果用户非常成熟或有足够的决心:

  1. Open the Excel VBA editor
  2. Use the object browser to see the list of all sheets, including VERYHIDDEN ones
  3. Change the property of the sheet to VISIBLE or just HIDDEN
  1. 打开 Excel VBA 编辑器
  2. 使用对象浏览器查看所有工作表的列表,包括非常隐藏的工作表
  3. 将工作表的属性更改为 VISIBLE 或仅 HIDDEN

then they are probably sophisticated or determined enough to:

那么他们可能很成熟或有足够的决心:

  1. Search the internet for "remove Excel 2007 project password"
  2. Apply the instructions they find.
  1. 在 Internet 上搜索“删除 Excel 2007 项目密码
  2. 应用他们找到的说明。

So what's on this hidden sheet? Proprietary information like price formulas, or client names, or employee salaries? Putting that info in even an hidden tab probably isn't the greatest idea to begin with.

那么这张隐藏表上有什么?专有信息,如价格公式、客户名称或员工工资?甚至将这些信息放在隐藏的标签中也可能不是最好的主意。