我無法用我的Excel macro
‘保存爲’我的表爲PDF
,以及將其保存在當前CSV
格式法「另存爲Object'_Workbook的失敗
這是一種行給我的問題在我的調試提前
ChDir "C:\Users\Owner\Google Drive\Lips\PDFs" <br>
ActiveWorkbook.SaveAs Filename:=".pdf", FileFormat:= _
xlPDF
謝謝!
Dim sPath as String, sFile as String
sPath = "C:\Users\Owner\Google Drive\Lips\PDFs\" 'this last backslash is necessary
sFile = Range("A1").Value & ".pdf"
sPath = sPath & sFile
'change other parameters as needed (can also use 'ActiveSheet` for just a given sheet
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= sPath, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= True
嗯...也許給一個文件專有名稱,不僅「.pdf」擴展名? – GSazheniuk
它只是動態的。有沒有辦法引用單元格A1,因爲它具有訂單ID,然後將.pdf擴展名添加到該單元格中? – PortaDoor
filename = Cells(1,「A」)&「。pdf」,並在下一行ActiveWorkbook.SaveAs文件名:=文件名,FileFormat:= _ xlPDF – GSazheniuk