14-11-19 08:42 PM
a month ago
I am also looking for this solution? Can anyone provide solution to this issue please?
a month ago - last edited a month ago
Hi @MatthewBelia1 and @dvashish
You can create new action, Here I named as Fit to page and copy" Check instance and workbook" step from Activate worksheet action as in the screenshot.
There are no output parameters for this action.
In the code stage use below code. you can tweak based on your requirement
Dim ws As Object = GetWorksheet(handle, workbookName, worksheetName, False)
Dim sheetExists As Boolean = ws IsNot Nothing
' If the worksheet exists, apply the fit to page setup
If sheetExists Then
ws.PageSetup.Zoom = False ' Disable Zoom to enable FitToPages
ws.PageSetup.FitToPagesWide = 1 ' Fit to one page wide
ws.PageSetup.FitToPagesTall = 1 ' Fit to one page tall
End If
a month ago
Hi @harish.mogulluri ,
Thank you for sharing the solution.
Would it be possible to input the number of sheets in this code.
Like, I have to make the first three tabs/sheets of the excel to fit to page.
Thanks!
a month ago
Hi @dvashish
You can loop through each worksheet and update the excel to fit to page
If you found this solution helpful, please mark it as the best answer or give it a thumbs-up