DocTo icon indicating copy to clipboard operation
DocTo copied to clipboard

Ability to convert a sheet or a group of sheets from an Excel file

Open njz3 opened this issue 2 years ago • 4 comments

Feature request: convert only a single sheet, or a group of sheets in an excel file. For exemple, given a file with 3 sheets (tabs): Sheet1, Sheet2, Sheet3, being able to convert/print only a given sheet to a PDF, or print a selection of sheets.

njz3 avatar Apr 25 '22 13:04 njz3

Thank You for the Issue. I will try to get to look at it as soon as I can.

github-actions[bot] avatar Apr 25 '22 13:04 github-actions[bot]

Thanks for taking the time to log the request.

I'll look at it. If you found the VBA method to make this happen it would speed up progress.

tobya avatar Apr 25 '22 15:04 tobya

I guess it is this VB function: https://docs.microsoft.com/en-us/office/vba/api/excel.sheets.printout

In particular this method where the selected sheet is specified: Worksheets. ("sheet1").PrintOut From:=2, To:=3

njz3 avatar Apr 25 '22 15:04 njz3

Seems by selecting the sheet first you can output only that sheet

    Sheets("Sheet1").Select
    ActiveWorkbook.Save
    ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        "C:\Users\tobyl\OneDrive\Book sdfasf1.pdf", Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
        True

I'll try and do it when i can

tobya avatar Apr 26 '22 20:04 tobya