Set sensor alert value with .SensorAlertValue1

Hi everyone,

I'm trying to change the alert values of a sensor but my code doesn't want to do anything. 

Here is my code:

Sub changeModel()
Dim swApp As SldWorks.SldWorks
Dim swDoc As SldWorks.ModelDoc2
Dim swFeat As SldWorks.Feature
Dim swFeatureMgr As SldWorks.FeatureManager
Dim swSweepFeatureData As SldWorks.SweepFeatureData
Dim swSweep As SldWorks.SweepFeatureData
Dim swEquationMgr As SldWorks.EquationMgr
Dim swSensorFeat As SldWorks.Feature
Dim swSensor As SldWorks.Sensor
Dim swDimSensor As SldWorks.DimensionSensorData
Dim alertVal1Dbl As Double
Dim alertVal2Dbl As Double

Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set swFeatureMgr = swDoc.FeatureManager
Set swEquationMgr = swDoc.GetEquationMgr

featVar = swFeatureMgr.GetFeatures(True) 'get all features into featVar variant array

For i = 0 To UBound(featVar) 'loop though features
Set swFeat = featVar(i) 'set swFeat object to current feature in loop
If swFeat.GetTypeName2 = "SensorFolder" Then 'if that feature is a sensor folder continue into if

Set swSensorFeat = swFeat.GetFirstSubFeature 'set swSensorFeat object to first subfeature in sensor folder
Debug.Print swSensorFeat.Name 'check it's the right feature
Set swSensor = swSensorFeat.GetSpecificFeature2 'set swSensor object

alertVal1Dbl = 15 'set alertVal1Dbl variable value
alertVal2Dbl = 300 'set alertVal2Dbl variable value
swSensor.SensorAlertValue1 = alertVal1Dbl 'set .SensorAlertValue1 of swSensor to alertVal1Dbl
swSensor.SensorAlertValue2 = alertVal2Dbl 'set .SensorAlertValue2 of swSensor to alertVal1Db2

swSensor.UpdateSensor 'update sensor (not sure if needed)

Debug.Print swFeat.ModifyDefinition(swSensor, swDoc, Nothing) 'update swFeat (not sure if needed, always returns false, this may be the issue)
End If
Set swFeat = Nothing 'clear swFeat object to free memory
Next i

swDoc.ForceRebuild3 (False) 'force rebuild (not sure if needed but probably good to have)

2021 SOLIDWORKS API Help - SensorAlertValue1 Property (ISensor)  The documentation states "Gets or sets the alert value for this sensor." and I'm following the example here too.  I must be missing something probably quite simple, any  help to point me in the right direction would be great!

SolidworksApi/macros