c# - How to open excel file and rename excel worksheet? -


ok, i've search other questions regarding topic have not yet found answer. need read excel file , rename excel worksheet programmatically. i'm using 2007 excel. help? tip?

personally, i'd use free library such epplus this. think cleaner , easier use interop.

something this:

fileinfo finfo = new fileinfo(@"c:\temp\book1.xlsx"); using (var excelpackage = new excelpackage(finfo)) {     excelworksheet ws = excelpackage.workbook.worksheets["sheet1"];     ws.name = "newworksheet name";     excelpackage.save(); } 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -