【问题标题】:Excel Automation - Print Entire Workbook settingExcel 自动化 - 打印整个工作簿设置
【发布时间】:2011-05-20 19:54:28
【问题描述】:

在 Excel 对象库中是否有设置打印首选项以打印整个工作簿而不是活动工作表的界面?

【问题讨论】:

    标签: c++ printing automation excel


    【解决方案1】:

    不,PageSetup 仅适用于工作表

    你能做的最好的就是复制所需设置的宏

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多