+ Reply to Thread
Results 1 to 3 of 3

ExportAsFixedFormat with multiple worksheets problem

  1. #1
    Registered User
    Join Date
    07-16-2021
    Location
    Bloomington, MN
    MS-Off Ver
    10
    Posts
    14

    ExportAsFixedFormat with multiple worksheets problem

    I'm writing VBA in MS Access to control an Excel workbook. The final stage of the process is printing two of the worksheets in the workbook to PDF. I'm having a problem combining the two worksheets and printing them. I keep getting error 438 "Object doesn't support this property or method). Printing to PDF one of the worksheets works OK but I should be able to combine two or more. Here's the code:

    Please Login or Register  to view this content.
    The commented out line is the one that works but I need the first line, with the Array statement, to work.

    Thank you for your help.

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

    Re: ExportAsFixedFormat with multiple worksheets problem

    Maybe use the ExportAsFixedFormat method, but for a workbook.
    Idea of operation:
    1. discover all sheets, but remember the visibility state of each sheet
    2. hide all the unnecessary ones
    3. export to PDF
    4. discover all sheets
    5. restore the original visibility of the sheets.

    If export to PDF is the only action performed with the file, the macro will limit itself to the first three items in the above list, without remembering the visibility state. After the export, close the file without saving.
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    07-16-2021
    Location
    Bloomington, MN
    MS-Off Ver
    10
    Posts
    14

    Re: ExportAsFixedFormat with multiple worksheets problem

    Thank you very much for replying.

    I tried something that shouldn't have worked but did:

    Please Login or Register  to view this content.
    So far, it works even though the SELECT statement shouldn't work.

    Thanks again for replying. I will keep your code in case my solution fails at some point.

+ 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. VBA Exportasfixedformat multiple pages all wrong sizes!!
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2015, 11:28 AM
  2. Replies: 0
    Last Post: 03-23-2014, 11:08 AM
  3. Formula Problem Across Multiple Worksheets
    By dfeagans in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-04-2013, 05:00 AM
  4. [SOLVED] ExportAsFixedFormat FileName problem
    By ikslohap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2012, 07:08 PM
  5. Problem: Printing Multiple Worksheets
    By hickory8 in forum Excel General
    Replies: 2
    Last Post: 05-04-2009, 06:02 PM
  6. Problem searching multiple worksheets via VBA
    By madbloke in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-06-2009, 06:01 AM
  7. Multiple worksheets problem
    By jilldean in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-17-2006, 12:55 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