如何利用宏让Excel 2010另存为PDF时,文件名指定为某一单元格内容?

我对VB不是特别懂,我想问一下,当我需要让Excel 2010另存为PDF格式时,同时又能让文件名指定到某个单元格(如A1),请高手解答,告诉我正确的VB语句,谢谢。

activeworkbook.saveas "e:\" & [a1] & ".pdf"

试下面这两段,不知道版本,不确定哪个好用
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="D:\另存为.pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False

ActiveDocument.ExportAsFixedFormat OutputFileName:="D:\Doc1.pdf", _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-05-05
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="D:\另存为.pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False

ActiveDocument.ExportAsFixedFormat OutputFileName:="D:\Doc1.pdf", _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
相似回答