开发者

Excel Automation - Print Entire Workbook setting

Within the Excel object library is there an interface to setting the print preferences to print the entire workbook instead of开发者_JAVA技巧 the active sheet?


No, PageSetup applies only to sheets

Best you can do is a macro to copy the required settings

Sub CopyPageSetup()
    Dim sh As Worksheet, cl As Range
    Dim shBase As Worksheet

    Set shBase = ActiveSheet
    For Each sh In ActiveWindow.SelectedSheets
        If sh.Name <> shBase.Name Then
            sh.PageSetup.Orientation = shBase.PageSetup.Orientation
            ' Add other PageSetup properties here '
            ' unfortunately sh.PageSetup = shBase.PageSetup does not work '
        End If
    Next

End Sub
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜