I want to print Excel Sheets in PDF

I want to print multiple Excel spread Sheets data into PDF as Tables.(I dont want to print each sheet in each page). I want to append one by one.

Hi @venkateshwara_rao

Welcome to the community

Save excel file as pdf
Is a modern activity

Can you try this once

Yes, i have tried modern activity but it prints each sheet in each page of pdf

@venkateshwara_rao

You mean in the same single oage you want all tables?

Cheers

Try to append the excel sheets first by append range activity then use save excel as pdf activity

Hope it helps
Usha

I wold like to print multiple sheets as many fit in a single page & remaining should be printed on the next page

@venkateshwara_rao

First use a copy paste range and copy all the data to the cirst sheet with formatting as well and then perform the print on only single sheet that way the file is adjusted as per the size

Cheers

All ready i have tried this one,but it wont help. Because I tried to fit the Columns exactly. For example in First table column A name will be large,in second table also column B will be large & and third table column C will be large.While adjusting it Column size is Extending but it will not work

@venkateshwara_rao

Then you need to go with a vba code only…edit as upu need…below is a sample

Sub PrintTryCont()
    Dim ws As Worksheet
    Dim rng As Range
    Dim totalRows As Long
    Dim maxRowsPerPage As Long
    Dim rowsPrinted As Long
    Dim currentSheet As Integer
   
    maxRowsPerPage = 45  ' change it as per your need
    
    Application.ScreenUpdating = False
   
    For Each ws In ThisWorkbook.Worksheets
        currentSheet = ws.Index
        
        totalRows = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
        
        rowsPrinted = 0
        
        Do While rowsPrinted < totalRows
            Set rng = ws.Range("A" & (rowsPrinted + 1)).Resize(Application.Min(maxRowsPerPage, totalRows - rowsPrinted))
            
            rng.PrintOut
            rowsPrinted = rowsPrinted + rng.Rows.Count
            
            If rowsPrinted < totalRows Then
                currentSheet = currentSheet + 1
                If currentSheet > ThisWorkbook.Worksheets.Count Then
                    Exit Do
                End If
                Set ws = ThisWorkbook.Worksheets(currentSheet)
            End If
        Loop
    Next ws
    
    Application.ScreenUpdating = True
End Sub

Cheers

Hi @venkateshwara_rao

You can use the save excel as pdf activity.

=> Take assign activity and create a Count varibale as int datatype and initialize the value as 1.

- Assign -> Count = 1

=> Take use Excel file activity and pass the excel path.
=> Inside use Excel file activity insert the for each excel sheet activity to iterate the each sheet in the Excel. Output - CurrentSheet
=> Inside for each place the save excel as pdf activity and give the range as CurrentSheet and in the pdf name give the name of the pdf let call it as output_pdffile.
We have to change the name of the pdf file for every pdf file, then pass the count variable like below

"Output_pdffile"+Count.toString+".pdf"

=> After save excel as pdf activity insert the assign activity to increment the count value

- Assign -> Count = Count+1

The above process will save the each excel sheet as a pdf.

Hope it helps!!