I'm not that used to model with api. But it looks like the feature manager would give you better ways of setting the options of the extrude.
Your current method seems to only allow one direction to be handled (true vs false).
I have this template that have been already extruded in 2 directions and the macro must only edit the 2 direction depth.
By the way thanks.
Opps sorry, I read the API reference too quick! You might already solved it but here is what I found out.
I played around a bit with it and found out you have to make the modifications per direction.It is the Forward as Boolean (or bool Forward in C#) that you should use. True for forward direction and false for reverse. In VBA it looks like this.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swPart As SldWorks.PartDoc
Dim swFeature As SldWorks.Feature
Dim swExtrude As SldWorks.ExtrudeFeatureData2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swPart = swModel
Set swFeature = swPart.FeatureByName("Boss-Extrude1")
Set swExtrude = swFeature.GetDefinition
swExtrude.SetEndCondition False, 0
swExtrude.SetDepth False, (100 / 1000)
swExtrude.SetEndCondition True, 0
swExtrude.SetDepth True, (100 / 1000)
swFeature.ModifyDefinition swExtrude, swModel, Nothing
Please mark the answer as correct if it helped you.
It just need to set the forward to false for direction1 and true for direction2..