下面这段是输出PDF的代码,用OFFICE不报错,但在WPS下报错,这是什么原因?
'判断打印单据路径
Dim printdir As String
If FileSys.FileExists(ProjectPath & "RemoteFiles\aaa.xls") Then
printdir = ProjectPath & "RemoteFiles\aaa.xls"
End If
Dim Book As New XLS.Book(printdir) '指定打印模板文件
Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.FileName = print
dlg.Filter = "PDF|*.pdf" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
If dlg.FileName = Nothing Then
Return
Else
Book.Build() '展开报表
Book.SaveToPDF(dlg.FileName) '保存为PDF文件
e.Form.Close
End If
End If
附:报错截图
此主题相关图片如下:微信图片_20230107163541.png
