Print Excel Worksheet Workbook

0 votes

I'm attempting to make a C# Winform app perform better.

Previously, it took 100000 milliseconds to generate an Excel file (using Office.Interop.Excel). It takes roughly 5000ms when using ClosedXml. Really Excellent But I have to print this Excel file now (only a Worksheet or the entire workbook)

I was doing this before (using office interop) :

public void PrintCurrentWorksheet()
{
    this._activeWorksheet.PrintOut(Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
}
public void PrintWorkbook()
{
    this._activeWorbook.PrintOut(Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
}

However, XLWorkbook and IXLWorksheet are the new types of _activeWorkbook and _activeWorksheet. The Printout method does not exist. Since OpenXml is not dependent on Excel, I assume there is no print method, which I was unable to find. Am I correct?

Oct 31, 2022 in Others by Kithuzzz
• 38,020 points
648 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Others

0 votes
1 answer

How do I protect all worksheet in an Excel workbook with a single click?

VBA Code : Dim ws as Worksheet Dim pwd ...READ MORE

answered Oct 22, 2022 in Others by narikkadan
• 63,680 points
827 views
0 votes
1 answer
0 votes
1 answer

Referencing an Excel file, workbook, worksheet in C#

Try the following code. using System; using System.Data; using Excel ...READ MORE

answered Nov 19, 2022 in Others by narikkadan
• 63,680 points
779 views
0 votes
1 answer

How to print an Excel Sheet using VBA with Nitro PDF Creator in Excel 2016

you can use the built-in excel facilities ...READ MORE

answered Sep 24, 2022 in Others by narikkadan
• 63,680 points
1,304 views
0 votes
1 answer

Print chosen worksheets in excel files to pdf in python

In the simplest form: import win32com.client o = win32com.client.Dispatch("Excel.Application") o.Visible ...READ MORE

answered Sep 24, 2022 in Others by narikkadan
• 63,680 points
3,514 views
0 votes
1 answer

Excel offset where reference is to another worksheet

Solution:  =OFFSET((INDIRECT(ADDRESS(1,1,,,"Sheet2")),ROW(),0,,) References: OFFSET(starting point, num of rows, num ...READ MORE

answered Oct 8, 2022 in Others by narikkadan
• 63,680 points
2,265 views
0 votes
1 answer

c#, Microsoft Interop Excel , change font style for s selected range

Change your code to this: worksheet.get_Range("B3", "B4").Cells.Font.Name = ...READ MORE

answered Oct 31, 2022 in Others by narikkadan
• 63,680 points
1,916 views
0 votes
1 answer

Activate last excel worksheet on worksheetlist with closedxml in c#

This will answer your question :  Changing sheet ...READ MORE

answered Nov 5, 2022 in Others by narikkadan
• 63,680 points
1,751 views
0 votes
1 answer

Microsoft.Office.Interop.Excel for Office 2007

Each client must install the  2007 Microsoft ...READ MORE

answered Nov 5, 2022 in Others by narikkadan
• 63,680 points
1,524 views
0 votes
1 answer

How do I merge multiple excel files to a single excel file

You copy a worksheet from before each ...READ MORE

answered Dec 24, 2022 in Others by narikkadan
• 63,680 points
913 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP