ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to do this? (https://www.excelbanter.com/excel-programming/337599-how-do.html)

cEcILle

how to do this?
 
Please open an excel application go to file menu then new. There will be the
action pane with the blank workbook and from existing workbook. then click
blank workbook. Then a new excel instance window will pop up. How can I do
the same behavior using C# language?

thank you



Peter Huang [MSFT]

how to do this?
 
Hi

We can automation Excel.
The code line below will create two new workbooks.

Excel.Application exApp = new Excel.ApplicationClass();
exApp.Visible = true;
exApp.Workbooks.Add(Missing.Value);
exApp.Workbooks.Add(Missing.Value);

Here is a KB article about how to automation Excel in C# for your reference.
302084 How To Automate Microsoft Excel from Microsoft Visual C# .NET
http://support.microsoft.com/?id=302084

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.



All times are GMT +1. The time now is 11:41 PM.

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