14-11-19 08:42 PM
22-10-24 07:52 PM
I am also looking for this solution? Can anyone provide solution to this issue please?
24-10-24 07:21 PM - edited 24-10-24 07:22 PM
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
25-10-24 03:09 PM
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!
25-10-24 03:19 PM
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