Need help with drive.writespeeds

I’ve a problem with these property.
I’ve created a Combobox. The name is speeds.

Private Sub Form_Initialize()
Set nero = New nero
Dim index%
ProgressBar.Value = 0
strMessages = “”
Dim drives As INeroDrives
Set drives = nero.GetDrives(NERO_MEDIA_CDR)

  For index = 0 To drive.WriteSpeeds.Count
    speeds.AddItem drive.WriteSpeeds(index)
  Next index   
For myIndex = 0 To drives.Count - 1
    AvailableDevices.AddItem drives(myIndex).DeviceName, myIndex
AvailableDevices.ListIndex = 0

Exit Sub
End Sub

the compiler is telling me “Object variable or with block variable not set”


The only problem I see is the range of the loop. It should be drive.WriteSpeeds.Count-1. Also, in VB it is perhaps more appropriate to write

	For Each speed In drive.WriteSpeeds
	speeds.AddItem speed