VBA를 통한 삽입을 완료하는 데 Excel 용 인 에이 블러에 문제가 있습니다. 아래 나열된 줄에 다음 런타임 오류가 나타납니다. 오류와Enabler for Excel Salesforce VBA 오류 삽입
라인 :
ip = automationObject.InsertData(ProdInArray, ObjectName, False, Nothing, error)
오류 : 사용자가 설정되기 때문에 여기에
Object reference not set to an instance of an object.
내 전체 VBA 코드 [명시 적 옵션]
Sub InsertOpportunityLineItem()
Dim addin As Office.COMAddIn
Dim automationObject As Object
Dim bot_prod As Integer
Dim column As Integer
Dim error As String
Dim ip As Variant
Dim ObjectName As String
Dim ProdInArray(10, 9999) As Variant
Dim Result As Boolean
Dim Row As Integer
ObjectName = "OpportunityLineItem"
For Each addin In Application.COMAddIns
If addin.Description = "Enabler for Excel" Then
Set automationObject = addin.Object
End If
Next addin
'Login to environment
Result = automationObject.LogIn(Username2, Password2, "https://test.salesforce.com", error)
If Result = False Then
MsgBox error
End
End If
'build insert array
For column = 0 To 10
For Row = 0 To 19
ProdInArray(column, Row) = Worksheets(ObjectName).Range("B1").Offset(Row, column)
Next Row
Next column
ip = automationObject.InsertData(ProdInArray, ObjectName, False, Nothing, error)
If Not error = Empty Then
MsgBox error
End
End If
'write update results array
For column = 0 To 1
For Row = 0 To 18
Worksheets(ObjectName).Range("R2").Offset(Row, column) = ip(column, Row)
Next Row
Next column
Result = automationObject.LogOut()
End Sub
가능한 복제본 [런타임 오류 '-2147467261 (80004003) 개체 참조가 개체의 인스턴스로 설정되지 않음] (http://stackoverflow.com/questions/23683973/run-time-error-2147467261-80004003) -object-reference-not-set-to-an-instance-o) – Brad
Amphitrite, 이것은 부가 기능의 버그입니다. 새로운 버전을 다운로드하려고 했습니까? – taralex