Firstly, please post your code using the toolbar button "</>" so that the code would be displayed in read-able format.
Now, as for the error you get from code ssetObj.AddItems ssobjs, I think the problem is due to how you fill up the element in the AcadEntity array (ssobjs).
Here is the code snippet of inner loop where you fill up the AcadEntity array:
ReDim ssobjs(0 To G - 1) As AcadEntity
For I = 1 To G - 1
If ssetObj.Item(I).ObjectID = ObjectID1 And ssetObj.Item(I).ObjectName = "AecDbWall" Then
Set ssobjs(I) = ThisDrawing.ModelSpace.Item(I)
MsgBox "ok"
Else
'MsgBox ssetObj.Item(I).ObjectName & " " & ssetObj.Item(I).ObjectID
End If
Next I
As you can see, you declared the array ssobjs with given element count (the count of all select-able items in a drawing, assume,it is 100). Then in the "For... Next I" loop, you ONLY fill up the array partially because of the "If...Then..." statement. That is, you have an array with 100 element declared, but only fill up 1 element due to the "If...Then..." statement (the rest 99 element are left empty)! After the "For ... Next I" loop, your code tries to add this partially filled array to the selectionset, THUS, the error.
My understanding is that you need a selectionset with one item in it, so that you can pass the selection set to SendCommand().
The code can be modified/simplified this way:
Sub test select()
Dim ent As AcadEntity
Dim ssetObj As AcadSelectionSet
Dim ssObjs() As AcadEntity
Dim I As Integer
Dim G As Integer
For Each ent In ThisDrawing.ModelSpace
'' You only need to to work for each "AecDbWall"
If UCase(ent.ObjectName)="AECDBWALL" THEN
ReDim ssObjs(0)
Set ssobjs(0)=ent
'' Create a selection set and select all, then clear it
'' So that AutoCAD remembers "Previous" selection set
Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SELECTIONSET1715")
ssetObj.Select acSelectionSetAll
ssetobj.Clear
ssetObj.AddItems ssobjs
'' These following SendCommand() calls would be problematic
'' If they work, it would be lucky :-(
ThisDrawing.SendCommand "Select p " & vbCrLf
ThisDrawing.SendCommand "Materiallist" & vbCr & vbCr
ThisDrawing.SelectionSets("TEST_SELECTIONSET1715").Delete
End If
Next
End Sub
HOWEVER, while this code I showed here would solve the issue with AcadSelectionSet.AddItems(), the entire process would likely not work because of calling SendCommand(0 in the "For..." loop: AutoCAD would/might execute the command called by SendCommand() asynchly, you may only get the last AecDbWall entity's information displayed, or no AecDbWall entity information displayed at all (because when the command "MaterialList" is sent to AutoCAD, the selection set ccreated by your code might have been deleted already.
I assume you are using AutoCAD Architecture. You should really use Archtecture's COM API to retrieve AecDbWall entity's information, instead of trying to get it from command line based on built-in command (well, I do not use AutoCAD Architecture, thus have no idea if there are COM APIs available that can be used in AutoCAD VBA. But I'd be very surprised if there is no COM API available, and if so, I'd not waste time in VBA at all).