请将附件下载成 sample.xlsx
链接: https://pan.baidu.com/s/1Q_Rcf-9L2jw9rkFKr2rxqw?pwd=mznq 提取码: mznq
很简单的格式
我希望保存成pdf,使用下面的代码
Sub pdf()
Dim wb As Workbook
Dim ws As Worksheet
Dim saveLocation As String
templePath = "d:\sample.xlsx"
Set wb = Workbooks.Open(templePath)
Set ws = wb.Sheets(1)
With ws.PageSetup
.Orientation = xlLandscape
End With
saveLocation = "d:\sample.pdf"
ws.ExportAsFixedFormat Type:=xlTypePDF, Filename:=saveLocation
wb.Close SaveChanges:=False
Set wb = Nothing
Set ws = Nothing
End Sub
产生的结果,仅仅显示了一半
设置成landscape,没有起作用
With ws.PageSetup
.Orientation = xlLandscape
End With
请问:如何修改代码?
这玩意后端直接导除啊