I am creating an Excel Worksheet from C# using Microsoft.Office.Interop.Excel, and I have not been able to get the footers the way the User wants them.
1) How can I put footer text in BOLD? 2) How can I put the page number in the footer? (Putting @"Page @[Page]" in as text does not work.)
Possible? Not Possible?
The following codes are from the SpreadsheetGear for .NET help and are compatible with Excel:
* Font codes appearing after any text or non-font codes will be ignored by SpreadsheetGear's printing engine.
1) worksheet.PageSetup.LeftFooter = "&B Bold text &B"
2) worksheet.PageSetup.CenterFooter = "Page &P"
A tip - open Excel and set up the footer you require via the UI, recording a macro of the actions you take. Then open the VBA editor. The generated VBA will give you clues for how to acheive the same thing via the API. This trick can be used in lots of scenarios when automating Excel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With