ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   C# syntax for getting multiple sheets? (https://www.excelbanter.com/excel-programming/341883-c-syntax-getting-multiple-sheets.html)

Mattias Beermann

C# syntax for getting multiple sheets?
 
I haven't been able to find the syntax for doing the following in C#:

Sheets(Array("Sheet1", "Sheet3")).PrintOut

Is it possible, how?

Myrna Larson

C# syntax for getting multiple sheets?
 
I'm no expert on C#, but perhaps the problem is that it doesn't "understand"
the array statement. Perhaps you can create a standard array, put the two
sheet names into it, and then print. Or print as 2 print jobs.

On Tue, 04 Oct 2005 21:59:24 +0200, Mattias Beermann wrote:

I haven't been able to find the syntax for doing the following in C#:

Sheets(Array("Sheet1", "Sheet3")).PrintOut

Is it possible, how?


Mattias Beermann

C# syntax for getting multiple sheets?
 
I figured out the correct syntax today, the error I did before was to
cast the result into the wrong type. If anyone else has the same
problem, the correct solution is:

string[] s = new string[] { "Kunder", "Konsulter" };
Sheets sheets = (Sheets)workbook.Sheets[s];
sheets.PrintOut(Missing.Value, Missing.Value, copies, false, printer,
Missing.Value, true, Missing.Value);



All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com