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