Forum Discussion

Excel_User490's avatar
Excel_User490
Copper Contributor
Jul 30, 2020

Issue saving Excel-file to desktop on any mac

Hi,

 

in our company we use a business system built in Excel. We wish to save files automatically in PDF-format to the desktop using VBA/macros.

 

The code in my macro point to a location in my own computer, and I wish that the macro could point to the general desktop when Excel is used in any computer.

 

Is it possible?

 

I have managed to make the VBA-code this far for a Mac:

 

ChDir "/Users/davidvingren/Desktop/"

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _ "/Users/davidvingren/Desktop/" & Range("A1"), Quality:=xlQualityMinimum, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False End Sub

 

 

Help very much appreciated!

1 Reply