Hi adnan,
Writing a Code stage to do this would be easy.
- Create a copy of any existing action of the MS Excel VBO
- Remove all unwanted data items, input, output parameters and keep the necessary ones - Refer 1.jpg
- Only pass the handle and the workbook to the Start stage parameter and to the Code stage. You can take a look at the other actions in the VBO.
- The below code is for inserting a Footer.
Note that this is to insert the same Footer in all Sheets. You will need to customize it if you need to add it to specific sheet(s) and if you need different Footers for different sheets.
Code:
Try
Dim wb As Object = GetWorkbook(Handle, Source_Workbook)
Dim sheets as Object = wb.Sheets
For Each sheet as Object in sheets
With sheet.PageSetup
.LeftFooter = "This is the Left Footer"
.CenterFooter = wb.FullName
.RightFooter = "This is the Right Footer"
End With
Next sheet
Success = True
Catch e As Exception
Success = False
Message = e.Message
Finally
End Try
- Refer 2.jpg for how the three different types of Footers look after running the process.
- Likewise to read a Footer you need to read them in a string and then pass them as an output to a Data item.
Code:
With sheet.PageSetup
strLeftFooter = .LeftFooter
strCenterFooter = .CenterFooter
strRightFooter = .RightFooter
End With