如何将 VBA 编辑器恢复到其初始设置?

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

How to restore VBA Editor to its initial settings?

excelvbavbe

提问by Stefyu Thechosenone

How to restore the VBA Editor to its intial settings ? I have some troubles with macro and projects explorer windows settings, after some bad manipulations.

如何将 VBA 编辑器恢复到其初始设置?经过一些错误的操作后,我在宏和项目资源管理器窗口设置方面遇到了一些麻烦。

回答by RubberDuck

The only way I know how to accomplish this is to edit the registry.

我知道如何完成此操作的唯一方法是编辑注册表。

  1. Close All Office programs
  2. Open a command prompt and type regedit
  3. Navigate to HKEY_CURRENTUSER\Software\Microsoft\VBA\6.0\Common
  4. Right click on Commonand Exportto save the *.reg file somewhere safe. This is your back up. Double clicking this file will restore your current settings.
  5. Right click on Commonand Deleteit. Doing this will remove all of its subkeys that hold your personal settings.
  1. 关闭所有 Office 程序
  2. 打开命令提示符并键入 regedit
  3. 导航到 HKEY_CURRENTUSER\Software\Microsoft\VBA\6.0\Common
  4. 右键单击Common导出以将 *.reg 文件保存在安全的地方。这是你的后盾。双击此文件将恢复您当前的设置。
  5. 右键单击Common删除它。这样做将删除所有包含您个人设置的子项。

The "Common" key will be recreated the next time you close the VBA Editor along with any changes to the settings you may make.

下次关闭 VBA 编辑器以及对设置所做的任何更改时,将重新创建“通用”键。

回答by digit6

Solution Using a Mac and Excel 2016.

使用 Mac 和 Excel 2016 的解决方案。

I found that I could drag the, e.g., project explorer (pe) window toward the edge of the vb window and the outline of the pe window moves and adjusts once you get close enough to the edge. This also works with the other windows as you bring them into view.

我发现我可以将例如项目资源管理器 (pe) 窗口拖向 vb 窗口的边缘,一旦靠近边缘,pe 窗口的轮廓就会移动和调整。当您将它们带入视野时,这也适用于其他窗口。

My default view is project explorer upper left, properties lower left. To return these to be in that order, drag the one to that location (which will fill that whole area) then drag the other one right on top of that one. That stacks them in the same column and then you can adjust their size within those locations.

我的默认视图是左上角的项目资源管理器,左下角的属性。要将这些恢复到该顺序,请将一个拖到该位置(将填充整个区域),然后将另一个拖到该位置的正上方。将它们堆叠在同一列中,然后您可以在这些位置调整它们的大小。

回答by FinaMarie

I had this same issue and fought with it for literally 2 days. Finally figured it out!!! xD First close the Project Explorer and the Properties windows using the X at the top right. Then go to Options under the Docking tab. Uncheck all boxes. Close the options window and if desired check to see that everything is undocked. Now go back to Options>Docking and check all the boxes you had checked (default is all but object browser). Your windows should have returned to default.

我遇到了同样的问题,并与之抗争了 2 天。终于想通了!!!xD 首先使用右上角的 X 关闭项目资源管理器和属性窗口。然后转到停靠选项卡下的选项。取消选中所有复选框。关闭选项窗口,如果需要,请检查所有内容是否都已取消停靠。现在返回选项>停靠并选中您选中的所有框(默认为对象浏览器除外)。您的窗口应该已恢复为默认值。

回答by FreeSoftwareServers

This may not solve the OPs original question of "default" for all, but in my case and possibly others I was looking to re-dock the "Project Explorer" and have modules pop up next to it like default. I'm not sure about other settings, but this is how I restored the above behavior.

这可能无法解决所有人的“默认”的 OP 原始问题,但在我和其他人的情况下,我希望重新停靠“项目资源管理器”,并像默认一样在它旁边弹出模块。我不确定其他设置,但这就是我恢复上述行为的方式。

In the project explorer right click and select "Dockable". Then insert a module and maximize it. This should restore what I consider default behavior.

在项目资源管理器中右键单击并选择“可停靠”。然后插入一个模块并最大化它。这应该恢复我认为的默认行为。

回答by barryleajo

I'm not aware of a 'reset' command but the starting point would be to go to the View menu and start by setting the Code, Project Explorer and Properties windows and then the Toolbars>Standard (toolbar) perhaps?

我不知道“重置”命令,但起点是转到“视图”菜单并通过设置“代码”、“项目资源管理器”和“属性”窗口开始,然后是“工具栏”>“标准”(工具栏)?