0
我正在尝试创建一个将Excel文件转换为PDF的批处理文件。是不是有什么毛病我的命令行,因为它似乎不工作:创建批处理文件
Dim i As Double
Dim sBatchFile As String
ActiveWorkbook.Save
sBatchFile = "C:\test.bat"
Open sBatchFile For Output As #1
Print #1, "@ECHO OFF"
Print #1, "ECHO Converting Excel Files to PDF, Please wait..."
Print #1, "batchpdf C:\Documents and Settings\Andrew_G\My Documents\Office Docs\Schedule.xls C:\Documents and Settings\Andrew_G\My Documents\Office Docs\TEST1234.pdf"
Close #1
i = Shell(sBatchFile, vbMaximizedFocus)
End Sub
是的,这解决了我的问题在CMD但不是在VBA。 – BioXhazard 2010-07-13 14:44:03
我只用双引号,它工作。谢谢 – BioXhazard 2010-07-13 15:23:30