Problem with plotting

The following code is not setting custom paper sizes? I can'tdetermine why? When I put watches on the "ps.PrinterPaperLength"and "ps.PrinterPaperWidth" values, they are changing from thedefault size. These are not carrying changing the size that isactually ploted. The value for ps.printerPaperSize is set to a"custom" size for my plotter. By default this value is set to 1until I change it to 257. I have tried leaving this out and stillnot positive results. Any suggestions?

Sub main()

Dim printer As String
Dim pageArray(0) As Long
pageArray(0) = 0

Set swApp = Application.SldWorks
Set model = swApp.ActiveDoc
Set swDraw = model
Set swSheet = swDraw.GetCurrentSheet

Set ps = model.PageSetup

If width = 41.5 And height = 24 Then
model.printer = "Engineering Plotter"
printer = "Engineering Plotter"
ps.Orientation = 2 ' 1=Portrait '2 = Landscape
ps.PrinterPaperSize = 257
ps.PrinterPaperLength = 42 * 254 ' 42 inches
ps.PrinterPaperWidth = 24 * 254 ' 24 inches
ps.ScaleToFit = False
ps.Scale2 = 100
ps.DrawingColor = 2

model.PrintPreview

End If

end subSolidworksApi macros