+ Reply to Thread
Results 1 to 2 of 2

Document to save as a PDF file and not a xls using a Macro

  1. #1
    Registered User
    Join Date
    05-23-2014
    Posts
    1

    Document to save as a PDF file and not a xls using a Macro

    Hi All

    I am extremely new to macros and formulas etc. This is the first Macro i have ever tried and certainly will not be my last.

    I wanted to have a invoice number generated and saved. What I found is a easy method on the net and works fine.

    My problem is that i would like to save the file as a pdf document and not a excel document. Is this possible by changing some things in the below code.

    Sub SaveInvWithNewName()
    Dim NewFN As Variant
    ' Copy Invoice to a new workbook
    ActiveSheet.Copy
    NewFN = "C:\aaa\Inv" & Range("E5").Value & ".xlsx"
    ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
    ActiveWorkbook.Close
    Nextinvoice
    End Sub


    Thanking you in advance.

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Document to save as a PDF file and not a xls using a Macro

    Hi

    Have a look at this post on Mr Excel;

    http://www.mrexcel.com/forum/excel-q...lications.html
    Remember you are unique, like everyone else

+ 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. Replies: 1
    Last Post: 09-05-2013, 02:39 PM
  2. How to save the opened word document as a Notepad/text file?
    By Rahul888 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-10-2012, 05:38 PM
  3. Save worksheet to document file name
    By fb2003 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-04-2008, 04:29 PM
  4. Replies: 2
    Last Post: 02-22-2006, 03:00 PM
  5. [SOLVED] 'document not saved' for 'save' or 'save as' an EXCEL file
    By Judy Chuang in forum Excel General
    Replies: 1
    Last Post: 07-11-2005, 06:05 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