Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to replace a particular string in Excel sheet with a specified string using C# or vb.net

I used a replace function which works properly in text file but not in excel sheet
Posted

Excel is a complex file format, you need to open it with something that understands it's structure (it is not a text file).

Try using this : http://epplus.codeplex.com/[^]
 
Share this answer
 
Comments
Chandan_N87 19-May-14 13:49pm    
Thanks a lot for the soution
Maciej Los 19-May-14 16:38pm    
+5
Mehdi Gholam 19-May-14 23:59pm    
Cheers Maciej!
MS Excel supports Find and Replace functions. Have a look here:
Range.Replace method[^]
Range.Find method[^]

Sample code you'll find here: How to: Programmatically Search for Text in Worksheet Ranges[^]
 
Share this answer
 
Comments
Mehdi Gholam 19-May-14 23:59pm    
5'ed
Maciej Los 20-May-14 1:36am    
Thank you, Mehdi ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900