I'm currently trying to query a schematic for a certain reference designator and then changing the model/spicefile path of the component, but (I assume) my code isn't matching the components with the refdes string I'm comparing it with. I get no errors running this so I'm at a loss for what to do.
Sub modify_comp(refD, model)
Dim objApp, oComp, oAttr
Set objApp = GetObject(,"ViewDraw.Application")
For Each oComp In objApp.Query(VDM_COMP, VD_ALL)
If oComp.REFDES Is refD Then
Set oAttr = oComp.FindAttribute("Model")
oAttr.Value = model
oComp.selected = true
Any help would be appreciated.