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