rhhvbanovice
New Member
- Joined
- Aug 5, 2009
- Messages
- 3
Hey,
New to VBA, mostly recording macros then editing what I can. I am trying to have a macro save a file as a PDF and extract the file name from a cell within the worksheet. The code works great on my computer but when I try to use it on any other computer it Returns run-time error 5. Here is the code, anything jump out?
Public Sub SaveAs()
'
' SaveAs Macro
Sheets("Report").Select
ChDir "\\JGNETWORK\jgmain\Personal Financial Statements"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\JGNETWORK\jgmain\Personal Financial Statements\" & Range("B5").Text, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Thanks!
New to VBA, mostly recording macros then editing what I can. I am trying to have a macro save a file as a PDF and extract the file name from a cell within the worksheet. The code works great on my computer but when I try to use it on any other computer it Returns run-time error 5. Here is the code, anything jump out?
Public Sub SaveAs()
'
' SaveAs Macro
Sheets("Report").Select
ChDir "\\JGNETWORK\jgmain\Personal Financial Statements"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\JGNETWORK\jgmain\Personal Financial Statements\" & Range("B5").Text, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Thanks!