Results 1 to 3 of 3

Save Active sheet as .pdf - file error

Threaded View

  1. #1
    Registered User
    Join Date
    03-23-2017
    Location
    Southampton, England
    MS-Off Ver
    2010
    Posts
    10

    Save Active sheet as .pdf - file error

    Good afternoon,

    I'm currently running VBA;

    Sub InvoiceSave()
    Dim stFileLocation As String
    ActiveSheet.Copy
    With ActiveSheet.UsedRange
        .Copy
        Range("A1").Select
    End With
    Application.CutCopyMode = False
    stFileLocation = Application.GetSaveAsFilename(InitialFileName:=" - Invoice")
    ActiveWorkbook.SaveAs Filename:=stFileLocation & "pdf"
    ActiveWorkbook.Close Savechanges:=False
    End Sub
    The file generates and saves as a .pdf, however upon opening the file, it pops up that it's unable to open because it is either not supported, corrupt or not decoded correctly

    Any ideas how to fix this?

    Thanks,
    PQ
    Last edited by AliGW; 03-23-2017 at 09:53 AM. Reason: Code tags added as a courtesy this once - please do this yourself in future posts. Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. save active sheet
    By VilMarci in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-06-2018, 12:00 PM
  2. [SOLVED] Save an active csv file into a given directory
    By plans in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-03-2017, 12:46 PM
  3. save .xlsx from active sheet, with sheet name, same address of current workbook
    By Mikeswell in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2014, 12:14 PM
  4. [SOLVED] save active sheet in new workbook, naming it as cell value of active sheet
    By arkharova.s in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2014, 06:16 AM
  5. [SOLVED] Copy row from active file to another formated excell file and save as one cell value
    By snsuvarna in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2013, 04:18 AM
  6. [SOLVED] VBA to save active sheet as new file with save as option
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-14-2013, 10:54 AM
  7. [SOLVED] Create a bouton to save as a pdf a another sheet then the active sheet using a custom name
    By sunny_island2002 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-14-2012, 08:01 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