Office 2016 -> 2013 “compile error, can't find project or library”

前端 未结 2 1985
时光说笑
时光说笑 2020-12-06 13:36

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

2条回答
  •  有刺的猬
    2020-12-06 14:06

    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")
    

提交回复
热议问题