+ Reply to Thread
Results 1 to 4 of 4

Save ActiveSheet to PDF

  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):

    Please Login or Register  to view this content.
    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.

  2. #2
    Registered User
    Join Date
    12-10-2005
    Posts
    4

    Re: Save ActiveSheet to PDF

    I would normally build the Path, Filename and Extension into a variable, and load it into your line.

    Please Login or Register  to view this content.
    HTH
    Last edited by royUK; 09-10-2010 at 12:52 AM. Reason: add code tags

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Save ActiveSheet to PDF

    Smithy73

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-11-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Save ActiveSheet to PDF

    Still the same error in the following.

    Please Login or Register  to view this content.

+ Reply to Thread

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