K
Kurt Remlin
Hi,
Is there a way to get a page width (either in points or inches) from
Excel directly?
I had to write my own VB function (see below) just for Letter and
Legal paper but wonder if there is a better way to do it.
==============================
Function PageWidth(xlWB As Excel.Workbook) As Single
With xlWB.ActiveSheet.PageSetup
If .Orientation = xlPortrait Then
PageWidth = 8.5
ElseIf .PaperSize = xlPaperLetter Then
PageWidth = 11
ElseIf .PaperSize = xlPaperLegal Then
PageWidth = 14
Else
PageWidth = 0
End If
End With
End Function
==============================
Is there a way to get a page width (either in points or inches) from
Excel directly?
I had to write my own VB function (see below) just for Letter and
Legal paper but wonder if there is a better way to do it.
==============================
Function PageWidth(xlWB As Excel.Workbook) As Single
With xlWB.ActiveSheet.PageSetup
If .Orientation = xlPortrait Then
PageWidth = 8.5
ElseIf .PaperSize = xlPaperLetter Then
PageWidth = 11
ElseIf .PaperSize = xlPaperLegal Then
PageWidth = 14
Else
PageWidth = 0
End If
End With
End Function
==============================