Find and replace value in Excel using C# -
How can I get some value from the cell and how can I replace the new value in Excel?
I tried it but it does not work:
Microsoft.Office.Interop.Excel.Application xlapp = New Microsoft.Office.Interop.Excel.Application ( ); Microsoft.Office.Interop.Excel.Workbook wb = Default (Microsoft.Office.Interop.Excel.Workbook); Wb = xlapp.Workbooks.Open (FileName.ToString ()); Wb.Worksheets [0] .Cells.Replace ("think", "replace");
I recommend you use that which is either directly through nodegate The codeplex can be directly accessed or visual studio. It gives you the ability to easily upload, edit, and create spreadsheets. NET
Example of uploading a spreadsheet:
HSSFWorkbook hssfworkbook; Zero InitializeWorkbook (string path) {// Read the template through FileStream, it has been suggested to use FileAccess. To stop file lock, read //book1.xls is an Excel-2007-generated file, so some new unknown BIFF records have been added. (Use the filestream file = new filestream (open path, file md. File, file reader.)) {Hssfworkbook = new HSSFWorkbook (file); }} Before you export, you can use the spreadsheet's IRO and ICL archive to find and edit the data needed.
More examples can be found
Comments
Post a Comment