How can I programatically retrieve the number of pages a workbook or worksheet will print to from the Excel 2007 Interop (Microsoft.Office.Interop.Excel)?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
are you looking for
ActiveSheet.PageSetup.Pages.Count
?Just use
"ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate:=True, IgnorePrintAreas:=False"
Change "From" and "To" to your pages.
PageSetup.Pages.Count will give the correct answer. But how to fetch the correct count if comments are printed at end of sheet.