AddPrintRange and PrintRange issue in Macro

I'm trying to control the number of pages I print using a macro, I've tried using both PrintRange and AddPrintRange

2015 SOLIDWORKS API Help - PrintRange Property (IPrintSpecification)

2015 SOLIDWORKS API Help - AddPrintRange Method (IPrintSpecification)

However the macro still just seems to print which ever the current selected sheet is, regardless what range is defined.

I'm trying to print to PDF however I have tried setting the printer to an actual one and the range is still incorrect.

Has anyone been able to get these functions to work?

SolidworksApi macros