运行时错误430.类不支持自动化或不支持预期的接口

时间:2018-03-06 12:22:07

标签: vba excel-vba outlook-vba excel

我在几个Pc中完美地工作,没有任何问题和错误。但是,当我,试图在其他PC运行它给出一个错误..运行时错误430.类不支持自动化或不支持预期的接口

    Dim ObjO As Object
    Dim olNs As Object
    Dim objFolder As Object

    Dim item1 As Object

    Dim sa As Date
    Dim spa As Date

    Set ObjO = CreateObject("Outlook.Application")
    Set olNs = ObjO.GetNamespace("MAPI")
    Set objFolder = olNs.GetDefaultFolder(6)

    spa = "27/02/2018"For Each item1 In objFolder.Items

  For Each item1 In objFolder.Items 
    sa = Format(item1.ReceivedTime, "dd-MM-yyyy")
             ex = item1.Subject
             Sheet2.Range("C1") = ex
        End If
    End If

Next

正是在最后一行代码中,我只在某些PC上遇到了这个问题

0 个答案:

没有答案