遇到问题,出现编译错误语法错误。我检查过了,但找不到错误间距在哪里。
有人能看到我的错误吗?
Sub Save()
' Save Macro
' Save PDF
'
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"S:\ACCESS INDUSTRIES HUB\OPERATIONS\JARED PO BOOK\PO.Range("C4").Value = Range("C4").Value.pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
答案1
我不相信您用来命名文件的方法会起作用,您需要类似以下的方法:
Dim MyDir As String
MyDir = "S:\ACCESS INDUSTRIES HUB\OPERATIONS\JARED PO BOOK\"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
MyDir & Range("C4").Value & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True