Couple of things. First, you have:
Which fills the array with blank ODE_object instances, but you then have:
Which is presumably inside a loop as you're using 'n' as an index. This fills the array again with ODE_objects, created and returned from the call to create_Box().
Also, in that code, you need to call set_material() after the call to create_Box().
Dim objects.ODE_object(200) For n=0 To 200 objects(n) = New ODE_object Next
Which fills the array with blank ODE_object instances, but you then have:
set_material(objects(n),mat_ice) objects(n)=create_Box(Rnd(-40,40),100+Rnd(0,600),Rnd(-40,40), x,y,z, Rnd(-30,30),Rnd(-30,30),Rnd(-30,30)) i = objects(n)\mat\index
Which is presumably inside a loop as you're using 'n' as an index. This fills the array again with ODE_objects, created and returned from the call to create_Box().
Also, in that code, you need to call set_material() after the call to create_Box().