【发布时间】:2013-06-06 21:47:40
【问题描述】:
以下代码导致“文档未保存”错误:
sFileName = "C:\test.pdf"
Application.DisplayAlerts = False
wkbPDF.Worksheets.Select
ActiveSheet.ExportAsFixedFormat Type := xlTypePDF, Filename := gsPDF_DIR & sFileName, _
Quality:=xlQualityStandard, IncludeDocProperties := True, _
IgnorePrintAreas := False, OpenAfterPublish := False
Application.DisplayAlerts = True
但在 VBA 之外执行此操作是成功的(但由于工作簿包含 100 多张工作表,因此需要几分钟时间)。
【问题讨论】: