在Excel对象库中,是否有一个接口可用于设置打印首选项以打印整个工作簿而不是活动工作表?
发布于 2011-05-21 10:21:21
否,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 Subhttps://stackoverflow.com/questions/6076963
复制相似问题