Excel Interop: Formatting Footers
excel, footer, format, interop
Solution
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.
Problem
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?