vba Excel 不会显示工作簿工作表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14691277/
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-11 19:27:15  来源:igfitidea点击:

Excel won't show the workbooks worksheets

vbahiddenworksheetexcel

提问by marj

I have an Excel Workbook containing three worksheets. However all sheets seem to be hidden dispite that their visibility is set to xlSheetVisible (Found by looking at the worksheet properties in the VBA editor).

我有一个包含三个工作表的 Excel 工作簿。然而,所有工作表似乎都隐藏了,尽管它们的可见性设置为 xlSheetVisible(通过查看 VBA 编辑器中的工作表属性找到)。

This is what I have tried so far to solve the problem.

这是我迄今为止尝试解决问题的方法。

  • Searched Google for help, but all similar problems have been solved by changing the Visibility from xlSheetHidden to xlSheetVisible. But in my case that setting is already set to xlVisible.

    • By using VBA I have tried to activate a sheet without any result.
  • 在谷歌搜索帮助,但所有类似的问题都通过将可见性从 xlSheetHidden 更改为 xlSheetVisible 来解决。但就我而言,该设置已设置为 xlVisible。

    • 通过使用 VBA,我试图激活一张没有任何结果的工作表。

By reading this you might have guessed that I am able to see and access the worksheets from the VBA editor.

通过阅读本文,您可能已经猜到我能够从 VBA 编辑器查看和访问工作表。

Despite that looking at the normal Excel userinterface, all buttons are disabled and clicking at the office/file button in the topleft corner doesn't allow me to save the workbook. However if I make any changes to the VBA itself and tries to close the workbook then Excel asks whether or not I would like to save the workbook.

尽管查看正常的 Excel 用户界面,但所有按钮都被禁用,单击左上角的办公室/文件按钮不允许我保存工作簿。但是,如果我对 VBA 本身进行任何更改并尝试关闭工作簿,则 Excel 会询问我是否要保存工作簿。

回答by StoriKnow

Everything you describe leads me to believe you're hiding the workbook window, not the worksheets. When a workbook window is hidden, all the sheets become hidden and much of the functionality from the toolbar greys out.

您描述的所有内容都让我相信您隐藏的是工作簿窗口,而不是工作表。隐藏工作簿窗口后,所有工作表都会隐藏,并且工具栏中的大部分功能会变灰。

In the Visual Basic Editor, you'd also be able to see all of the worksheets and their visibility would be xlVisible, yet they cannot be seen on the screen. This is because they ARE visible, but the window which displays them is not.

在 Visual Basic 编辑器中,您还可以看到所有工作表,它们的可见性将为xlVisible,但在屏幕上看不到它们。这是因为它们是可见的,但显示它们的窗口不可见。

Please try clicking the Viewtab in the toolbar, and then under the Windowpane, click Unhide.

请尝试单击工具栏中的“查看”选项卡,然后在“窗口”窗格下单击“取消隐藏”

enter image description here

在此处输入图片说明

If this doesn't work, then try toggling visibility of the workbook.

如果这不起作用,请尝试切换工作簿的可见性。

回答by Dexter1759