Hi,
I have created a macro in excel to save an excel file into PDF format and then save - which is then saved on the current user c:\drive
The problem is that need the path to default to the current username so that the macro can run on different machines.
The macro is:
I am not sure where & how to use the Environ VBA code to make this work.
Any help would be greatly appreciated.
Thanks.
L.
I have created a macro in excel to save an excel file into PDF format and then save - which is then saved on the current user c:\drive
The problem is that need the path to default to the current username so that the macro can run on different machines.
The macro is:
Code:
Sub Macro4()
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\smith\Dropbox (Company)\Test with MG\DFA (August 26, 2015) - Copy.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
I am not sure where & how to use the Environ VBA code to make this work.
Any help would be greatly appreciated.
Thanks.
L.
Last edited by a moderator: