Results 1 to 3 of 3

non programmer wanting help with a macro - save output to desktop

Threaded View

easy_lsm non programmer wanting help... 08-09-2017, 04:42 AM
nigelog Re: non programmer wanting... 08-09-2017, 05:11 AM
easy_lsm Re: non programmer wanting... 08-09-2017, 05:29 AM
  1. #1
    Registered User
    Join Date
    08-08-2017
    Location
    basel
    MS-Off Ver
    2010
    Posts
    7

    non programmer wanting help with a macro - save output to desktop

    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
    Last edited by easy_lsm; 08-09-2017 at 07:40 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro: How to save to a generic desktop
    By ExcelMacGuy in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 01-05-2016, 02:48 PM
  2. Macro Save as cell N5 & to computers desktop
    By T_BOLT in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-17-2014, 06:29 PM
  3. How to save as file on desktop with macro
    By slearner1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2013, 11:35 AM
  4. How to make this Macro work for any user so they can save to their desktop
    By Hardup in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2013, 07:56 AM
  5. [SOLVED] save to desktop macro
    By mike02 in forum Excel General
    Replies: 5
    Last Post: 08-01-2012, 06:12 PM
  6. save to desktop macro
    By asabti in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-20-2008, 04:30 PM
  7. Save Excel workbook to Desktop Using a Macro
    By Marvin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2006, 02:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1