+ Reply to Thread
Results 1 to 3 of 3

Save as Pdf

  1. #1
    Forum Contributor
    Join Date
    05-10-2016
    Location
    EUROPE
    MS-Off Ver
    Excel 365 64 bitt
    Posts
    178

    Save as Pdf

    Hi,

    I have recorded a macro for saving my sheet as pdf. with the same name of my Excel workbook.
    I would like macro to ask me with comment box to put the name of the file before it saves it to my desktop.

    Sub SaveasPdf()
    '
    ' SaveasPdf Makro
    '

    '
    Range("A1:F1").Select
    Range(Selection, Selection.End(xlDown)).Select
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "C:\Users\user1\Desktop\NAME .pdf", Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
    True
    End Sub

    Thanks for any help I can get.
    B.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Save as Pdf

    Try this, I had to change the folder location so it would work for me, change it back for your locations.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-10-2016
    Location
    EUROPE
    MS-Off Ver
    Excel 365 64 bitt
    Posts
    178

    Re: Save as Pdf

    Hi,

    I tried this method and I get Run-time error '1004': Application defined or object defined error.

    I was thinking also is it possible that for saving the pdf. the path would be ThisPC\Desktop (not under user)

    Thanks for the help.
    B.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel doesn't change the cell format on save through the workbook save button
    By mitko1994 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-16-2017, 03:09 PM
  2. Replies: 1
    Last Post: 04-29-2016, 11:55 AM
  3. Macro to Auto save a backup copy in a seperate location OR save file with a pop up
    By kdsanderson30 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2014, 12:38 PM
  4. Templates - Forcing Save as rather than Save on first save
    By Spitinyari in forum Excel General
    Replies: 4
    Last Post: 04-26-2012, 11:32 AM
  5. Disable Save As and Save - enable Save via button
    By LampCommandr in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-07-2011, 05:42 PM
  6. How to diasble save and save as menu but allow a save button
    By hon123456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2006, 04:55 AM

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