Output all digits of a double in VBA macro

I am trying to check values of dimensions with a VBA macro.

I already have a Dimension object (let's call it "d") and I can output the value via

Debug.Print d.Value

but this only outputs the first 15 digits. How can I output all 17 digits?

MSDN says (here Double.ToString Method (String) (System)  ) that there exists a method to do this:

Double.ToString("G17")

But if I write in the macro the following lines

...

Dim val As Double

val = d.Value

Dim str as String

str = val.ToString("G17")

...

then I get an error that the method (ToString) is not known.

I am using SolidWorks2016.

SolidworksApi macros