Quantcast
Channel: npoi Discussions Rss Feed
Viewing all articles
Browse latest Browse all 637

New Post: Copy one sheet from one workbook Microsoft Excel to another workbook Microsoft Excel C#

$
0
0
Copy one sheet from one workbook Microsoft Excel to another workbook Microsoft Excel (using NPOI Library)

In COM Excel:

Excel.Application xlApp=null;
Excel.Workbook xlWbSource ,xlWbTarget;
try {    xlApp = new Excel.Application();
    xlWbSource = xlApp.Workbooks.Open(@"D:\\table_2014.xls");
    xlWbTarget = xlApp.Workbooks.Add();
    
    (xlWbSource.Worksheets[1] as Excel.Worksheet).Copy(Before: xlWbTarget.Worksheets[1]);
    xlApp.Visible = true;
}
catch (Exception) {
    if (xlApp != null)
        xlApp.Quit();
}
And how to use this library do not know. Help me please

Viewing all articles
Browse latest Browse all 637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>