Results 1 to 4 of 4

Save ActiveSheet to PDF

Threaded View

rubix Save ActiveSheet to PDF 09-08-2010, 10:43 AM
smithy73 Re: Save ActiveSheet to PDF 09-09-2010, 11:39 PM
royUK Re: Save ActiveSheet to PDF 09-10-2010, 12:51 AM
rubix Re: Save ActiveSheet to PDF 09-10-2010, 09:49 AM
  1. #1
    Registered User
    Join Date
    08-11-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    11

    Save ActiveSheet to PDF

    Hello,

    I have a macro which runs through a list to the end and updates a cell in the activesheet which other cells vlookup onto. For each row in the list the macro calls the sub 'Print2' to print to pdf (one pdf per item in the list):

    Sub Print2()
          Sheets("Scorecard").Select
               ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\BMC_Scorecards\BMC_Scorecard_" & (Range("AK4").Value), _
            Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
            :=False, OpenAfterPublish:=False
    End Sub
    The cell value AK4, which forms the filename, changes as the macro moves through each row in the list.

    The problem is that the second item in the list returns the Run-time error '1004': Document not saved. the document may be open, or an error may have been envountered when saving. So I can only print the first pdf.

    Any thoughts?
    Last edited by Paul; 09-08-2010 at 12:26 PM. Reason: User added QUOTE tags instead of CODE tags. Close.

Thread Information

Users Browsing this Thread

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

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