办公室2016 - > 2013“编译错误,找不到项目或库” [英] Office 2016 -> 2013 "compile error, can't find project or library"

查看:263
本文介绍了办公室2016 - > 2013“编译错误,找不到项目或库”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到Office 2016,我的大多数用户还没有完成,当用户尝试运行我的脚本时,我会收到一个新的错误。

I just upgraded to Office 2016, which most of my users haven't done, and I'm getting a new error when users try to run my scripts.


编译错误,无法找到项目或库

"Compile Error, can't find project or library"

我查看了这些引用,它看起来像是试图引用Microsoft Word 16.0对象库,并且在运行Office 2013的计算机上缺少它。我看不到选择将我的引用更改为2013版本,我不知道如何让我的用户访问2016年的参考,而不升级所有人(现在不是一个选项)。

I looked in the references and it looks like it's trying to reference the "Microsoft Word 16.0 Object Library" and it's missing on machines running Office 2013. I don't see the option to change my reference to a 2013 version, and I don't know how to give my users access to the 2016 reference without upgrading everyone (not an option right now).

第一个可执行代码出现此错误

This error is coming up on the first executable line of code

Set app = Range("A2")


推荐答案

你需要包括Excel 15.0对象库以便使用这样的Excel.Range(A2)或使用如下所示的后期绑定:

You need to include the Excel 15.0 Object Library in order to use Excel.Range("A2") like that or use late binding as shown below:

  Dim excelApp As object, r as object
  Set excelApp = CreateObject("Excel.Application")
  Set r = excelApp.Range("A2")

这篇关于办公室2016 - > 2013“编译错误,找不到项目或库”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆