gpt4 book ai didi

使用宏打开受信任文档或启用宏时 Excel 崩溃

转载 作者:行者123 更新时间:2023-12-02 07:21:28 25 4
gpt4 key购买 nike

正如标题所示,我无法使用宏打开受信任的文档 - Excel 立即崩溃。制作文档的副本允许其打开(因为该副本不受信任),并且我可以检查 VB 编辑器中的宏,但启用宏会导致另一次崩溃。为什么会发生这种情况?我可以采取什么措施来解决它?

我今天遇到了类似的情况,即使实际上没有丢失项目或库,但在崩溃之前也会显示“找不到项目或库”对话框。

最佳答案

这是由具有编译错误的宏引起的。要修复此问题,请使用以下步骤(全部归功于 alulla at Ozgrid ,为了清楚起见,我对其方向进行了轻微调整):

  1. Open a new Excel workbook, not your crashing workbook
  2. Go to the Developer Tab and click “Macro Security” in the Code section of the Ribbon
  3. Click the bullet option entitled “Disable all macros with notification”
  4. Go to the Trusted Locations tab on the left and check the “Disable all Trusted Locations” box at the bottom
  5. Go to Trusted Documents and check the “Disable all Trusted Documents” box
  6. Click OK and close the new workbook
  7. Open your Excel file that was crashing
  8. Do not click "Enable Macros" - instead go to the Developer Tab and open the Visual Basic Editor
  9. In the VB Editor, save the project and then click Debug > Compile VBAProject
  10. Correct any compile errors that occur
  11. Save the VB project again and then save the Excel workbook
  12. Revert any changes you made to Macro Security in steps 3-5
  13. Close Excel, re-open the previously crashing workbook, and Enable Macros

我今天的经历是,这还可以解决“找不到项目或库”崩溃(实际上没有丢失任何引用)的问题,以及在您首先进入引用对话框之前 Excel 崩溃的问题。

关于使用宏打开受信任文档或启用宏时 Excel 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44954669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com