CreateObject for Excel:正常运行有效,以管理员身份运行不正常?

时间:2019-08-21 12:14:32

标签: excel vb6 office365

Option Explicit

Private Sub Command1_Click()
On Error GoTo Command1_Click_EH
Dim objXL As Object
Dim wbXL As Object

' ***************

Set objXL = CreateObject("Excel.Application")

' ***************

objXL.ScreenUpdating = False 
Set wbXL = objXL.Workbooks.Add
objXL.Visible = True

Exit Sub

Command1_Click_EH:
MsgBox Err.Description
End Sub

错误是

  

“ ActiveX组件无法创建对象”

以管理员身份运行时,在第CreateObject行的

,否则运行成功。

错误仅适用于 office365

version 1906 
Build 11727.2044 Microsoft store
Monthly Channel

0 个答案:

没有答案