Quote Originally Posted by easy_lsm View Post
Hi All,

I recorded a macro in excel and all worked well but now I need to share this with others to use and unfortunately I am stuck on creating the file path for the desktop as it requires each person to save to their own desktop account.
I have tried looking this up and was able to generate a file on the desktop but unfortunately it would not open (no content).
Here is my original code (from recording).
Sub SavePDF()
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
        Filename:="C:\Users\xxxxxxx\DeskTop\Remedy_on_Demand_Request.pdf", _
        OpenAfterPublish:=True
End Sub
This works for myself but obviously not for others.

This is the code I found to point to the desktop but the file will not open as I am guessing I am not telling it to be of fixed format xlpdf.

Sub SavePDF()

Dim DTAddress As String
DTAddress = CreateObject("WScript.Shell").SpecialFolders("Desktop") & Application.PathSeparator
ActiveWorkbook.SaveAs DTAddress & " Remedy_on_Demand_Request.pdf "

End Sub



Can someone help me to piece these together and work........... I would be so grateful

cheers Easy like sunday morning
Its a rule of the forum code tags are to be used to aid reading.