如何将 Access 2003 与 Excel 2010 一起使用?
我支持使用 VBA 在 Access 2003 中编写的旧应用程序。我们正在将系统更新到 Office 2010,但 Access 除外,它将保留 2003 版本。 (这是由于与我的组织中其他组相关的几个因素造成的。)
我们使用 Access 作为从 MS SQL 和 Sybase 数据库运行报告的前端。其中一些报告可以在 Excel 中打开。在测试过程中,运行写入 Excel 工作簿的报表会导致 Access 应用程序崩溃并退出,且没有警告消息 - 应用程序只是从屏幕上消失。
我不确定这是什么原因或我应该从哪里开始寻找答案。有人处理过类似的情况吗?
I am supporting a legacy application that was written in Access 2003 using VBA. We are updating our systems to Office 2010, with the exception of Access, which will remain the 2003 version. (This is due to several factors pertaining to other groups in my organization.)
We use Access as a front end for running reports out of MS SQL and Sybase databases. Some of these reports open in Excel. During testing, running reports that write to an Excel workbook causes the Access application to crash and exit without a warning message - the application simply disappears from the screen.
I'm not sure what the cause of this is or where I should start looking for answers. Has anybody dealt with a similar situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在安装了 Office 2010 的开发计算机上保存并重新编译了该应用程序,此后该应用程序可以在 Office 2010 中正常运行(当然,它不再在仅安装 Office 2003 的计算机上运行。)当然,这是在检查了参考文献是正确的。在没有任何干预的情况下,所提到的 Office 是 2010 年的。
在对早期绑定与后期绑定进行测试后,此问题的最佳答案似乎是使用后期绑定。
I saved and recompiled the application on the development machine that had Office 2010 installed, and thereafter the application worked correctly with Office 2010 (of course, it no longer works on machines only having Office 2003.) This was, of course, after checking the references were correct. Without any intervention, the reference to Office was for 2010.
After testing with early versus late binding, it would appear the best answer to this issue is to use late binding.
确保您在 Excel 兼容模式 (.xls) 下写入 Excel。
Make sure you are writing to Excel in Excel compatibility mode (.xls).