Getting physical dimension value out of particular sketch?

Hi,

at the moment I am stuck with trivial issue (it should be, unless I don't get this at all) in regards to passing dimension out of sketch:

Dim swPart as IPartDoc

Dim featureOfPart as IFeature = Nothing

Dim sketchWidth As IDimension = Nothing

Dim dblSketchWidth as Double = 0

swPart = swApp.ActiveDoc

featureOfPart = swPart.FeatureByName("Something")

sketchWidth = featureOfPart.IParameter("Width@SomethingSketch@SomethingPart.sldprt")

dblSketchWidth = sketchWidth.IGetSystemValue3(swInConfigurationOpts_e.swThisConfiguration, 1, Nothing)

MsgBox (dblSketchWidth)

Getting an error: "Use the "new" keyword to create object instance.".

Tried other functions (dimension.value, IGetValue3) which returns double value from dimension but with same issue and message.

IGetSystemValue3 should return double value of the length. Please let me know what I am missing here. I tried to use SelectionByID, but that function uses x, y, z coordinates and what I need it is length of line, not its location in space. BTW using SW2014 with Visual Basic.Net as macro language.

Thanks.

SolidworksApi macros