+ Reply to Thread
Results 1 to 4 of 4

VBA to save one sheet as PDF DO NOT PRINT

  1. #1
    Registered User
    Join Date
    09-26-2021
    Location
    London
    MS-Off Ver
    excel Mac
    Posts
    6

    VBA to save one sheet as PDF DO NOT PRINT

    I’m not very familiar with VBA but I think I’ve managed to get the basics. USING MAC

    What I’m looking for:

    I want VBA to save sheet1 (NB) as a PDF

    we have multiple users, not too sure how to make it accessible for all. (Using Mac)

    Want file to save as cell text in Cell A4


    What’s currently happening is the PDF is trying to find a printer and not saving?

    Any advice would be much appreciated!

    Code below:

    Sub TESTINGMACRO()
    Dim path As String
    path= “/Users/Sue/Documents/business name/External Documents/NB Docs/“& Sheets(“NB”). Range(“A4”).Text
    Sheets(“NB”).ExportAsFixedFormat Type:=x1TypePDF, _
    FileName:= path
    End Sub

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,545

    Re: VBA to save one sheet as PDF DO NOT PRINT

    Probably the problem is related to the wrong constant name. Instead of x1TypePDF, it should be xlTypePDF.

    Artik

  3. #3
    Registered User
    Join Date
    09-26-2021
    Location
    London
    MS-Off Ver
    excel Mac
    Posts
    6
    Quote Originally Posted by Artik View Post
    Probably the problem is related to the wrong constant name. Instead of x1TypePDF, it should be xlTypePDF.

    Artik
    doh!

    Regarding the user in the path section, have you any idea how I can get this to change per username via Mac?

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,545

    Re: VBA to save one sheet as PDF DO NOT PRINT

    I don't use a Mac. Try to build the path chain this way
    Please Login or Register  to view this content.
    Artik

+ 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. Save sheet to PDF without using print spooler
    By Ron2021 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-30-2021, 01:10 PM
  2. VBA to save sheet as print area
    By chris1888 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-25-2020, 06:52 AM
  3. Save As / Print PDF using sheet name as file name
    By wine gums in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-30-2020, 11:58 AM
  4. Print each sheet to PDF Printer NOT Using Save as PDF Function
    By esposit513 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2018, 05:23 PM
  5. Save multiple sheet/print sheet with one command button
    By GJR in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-23-2014, 03:06 PM
  6. Selecting Columns to print or save to another sheet
    By sanlen in forum Excel General
    Replies: 0
    Last Post: 08-27-2010, 12:00 AM
  7. save sheet & print automaticly
    By roots in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2006, 11:30 PM

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