Jump to content

VBA - Error to SetXRecordData from Listbox


Recommended Posts

Posted

Hi again,

 

I have a Userform.Listbox with data that I need to place in a XRecordData, but when I input 10 items in the list, the routine shows me the error:

"Method 'SetXrecordData' of Object 'IAcadXrecord' Failed"

If someone can tell me what I am doing wrong?

Thank you in advance...

Public Sub SaveBatchList()
   Dim LBL5
   Dim BatchName
   Dim BatchLines
   Dim BatchPath
   Dim XCode() As Integer
   Dim i As Integer
   LBL5 = UserForm1.ListBox5.List
   ReDim BatchName(UBound(LBL5))
   ReDim BatchLines(UBound(LBL5))
   ReDim BatchPath(UBound(LBL5))
   ReDim XCode(UBound(LBL5))
   For i = 0 To UBound(LBL5)
       BatchName(i) = LBL5(i, 0)
       BatchLines(i) = LBL5(i, 1)
       BatchPath(i) = LBL5(i, 2)
       XCode(i) = i + 1
   Next
   BatchNameXRec.SetXRecordData XCode, BatchName
   BatchLinesXRec.SetXRecordData XCode, BatchLines
   BatchPathXRec.SetXRecordData XCode, BatchPath
   
   
End Sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...