求助,利用vbs将文档转换成pdf,本地没问题,到了服务器就有问题了
阳阳_阳阳 2019-02-22 11:10:26 求助大佬。
我写了一个vbs转换word,excel,ppt转换成pdf,在本地运行一点问题都没有,但是到了服务器上,就excel和ppt的转换有问题,利用java main方法执行vbs,excel和ppt的vbs文件调用后就没有结果了,很是迷茫。word的调用直接就好了。求大佬帮助解决一下,不胜感谢。服务器是windows
word的vbs
'path = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path
path = "E:\pdf\word"
Set word = CreateObject("Word.application")
Set docx = word.Documents.Open(path & "\" & "tmp.doc")
docx.SaveAs path & "\" & "tmp.pdf",17
docx.close(doNotSaveChanges)
word.Quit
set docx = nothing
Set word = nothing
excel的 vbs
'path = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path
path = "E:\pdf\word"
Set objArgs = WScript. Arguments
Set oExcel = CreateObject("Excel.Application")
Set oWb = oExcel.Workbooks.Open(path & "\" & "tmp.xls")
oWb.ExportAsFixedFormat xlTypePDF, path & "\" & "tmp.pdf", 1,1,1,1
oExcel.Visible = False
oExcel.quit
Set oWb = Nothing
ppt的vbs
'path = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path
path = "E:\pdf\word"
Set ppt = CreateObject("PowerPoint.application")
Set pptfile = ppt.Presentations.Open(path & "\" & "tmp.pptx",false,false,false)
pptfile.Saveas path & "\" & "tmp.pdf",32,false
ppt.Quit
Set pptfile= nothing