Excel 2007/2010: This workbook has lost its VBA project....

本文解决了在安装ASAP Utilities后启动Excel时遇到的错误问题。原因是安装Microsoft Office时未选择“Visual Basic for Application”。解决方案是在控制面板中更改Office安装选项,确保VBA已启用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Question

I have installed ASAP Utilities on my computer with Excel 2007/2010. Now when I start Excel I get the following error message:

"Repairs to 'ASAP Utilities.xla'
Excel was able to open the file by repairing or removing the unreadable content.
This workbook has lost its VBA project, ActiveX controls and any other programmability-related features"
Excel-2007-without-VBA-installed-error.gif

Answer

You get this error because during the installation of MS Office 2007/2010, "Visual Basic for Application" was not installed.

To solve this you need to change your installation of MS Office.

  1. Close Excel if it is open.
  2. In the Windows Control Panel choose "Add or Remove Programs" (or Programs and Features in Windows Vista or Windows 7).
  3. Select Microsoft Office in the list and click on the Change button.
  4. Choose "add or remove features"
    Excel-2007-install-VBA-1.png
  5. Select "Visual Basic for Applications" in the "Office Shared Features" list and set it to "Run from My Computer". Then click on the continue button.
    Excel-2007-install-VBA-2.png
  6. After the installation is finished you will be able to use ASAP Utilities when you start Excel and see ASAP Utilities in the menu.


From:http://www.asap-utilities.com/faq-questions-answers-detail.php?m=145




<think>嗯,用户想了解如何在当前工作簿中计算所有公式,特别是使用ExcelWorkbook对象,并且设置循环引用选项。首先,我需要回忆一下ExcelVBA相关功能。计算所有公式的话,可能需要用到Workbook对象的Calculate方法或者Application.CalculateFull方法。循环引用的话,Excel通常默认会提示错误,但用户可能需要调整迭代计算设置,允许循环引用并设置最大迭代次数。 接下来,用户提到ExcelWorkbook,可能是指通过VBA操作工作簿。在VBA中,Workbook对象代表整个工作簿,所以应该使用ThisWorkbook来引用当前工作簿。然后,循环引用的设置可能涉及Application对象的属性,比如Iteration属性控制是否启用迭代计算,MaxIterations设置最大迭代次数,MaxChange设置最大变化量。 步骤应该是这样的:首先确保所有公式正确,然后通过VBA代码启用迭代计算,设置迭代次数和变化量,最后执行计算整个工作簿。需要注意的是,循环引用可能导致结果不收敛,所以需要谨慎处理。 用户可能需要具体的代码示例,比如在VBA中如何编写这样的宏。同时,需要提醒用户循环引用的风险,比如无限循环或计算结果不准确。另外,是否还有其他方法,比如手动在Excel选项中设置迭代计算,或者使用快捷键计算工作表。 可能需要检查是否有相关的引用资料,比如微软的官方文档对Workbook.Calculate方法的说明,或者Application对象的Iteration属性设置。确保给出的代码正确且符合最佳实践。 总结一下,回答应该分步骤说明如何用VBA代码实现计算所有公式并设置循环引用选项,包括代码示例和注意事项。同时,生成相关问题帮助用户深入理解。</think>### 如何在Excel中计算工作簿所有公式并设置循环引用 #### 1. 手动计算所有公式 **步骤:** - 打开Excel工作簿,按下 `F9` 键直接计算所有打开的工作簿中的公式 - 若仅计算当前工作簿,使用组合键 `Ctrl + Alt + F9` 强制重新计算所有公式(包括依赖关系) #### 2. 通过VBA代码实现 **使用 `Workbook.Calculate` 方法:** ```vba Sub CalculateAllFormulas() ThisWorkbook.Calculate '计算当前工作簿 'Application.CalculateFull '计算所有打开的工作簿 End Sub ``` #### 3. 设置循环引用选项 Excel默认禁止循环引用,需通过VBA或手动设置: ```vba Sub EnableCircularReference() Application.Iteration = True '启用迭代计算 Application.MaxIterations = 100 '最大迭代次数 Application.MaxChange = 0.001 '最大变化阈值 End Sub ``` **参数说明:** - `Iteration=True` 允许循环引用[^1] - `MaxIterations` 控制公式重算次数 - `MaxChange` 定义收敛判定阈值 #### 4. 完整操作示例 ```vba Sub FullCalculationWithCircular() With Application .Iteration = True .MaxIterations = 200 .MaxChange = 0.0001 End With ThisWorkbook.Calculate End Sub ``` §§注意事项§§ 1. 循环引用可能导致计算结果不收敛 2. 迭代次数过多会降低性能 3. 建议先使用「公式」→「错误检查」→「循环引用」定位问题单元格
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值