I'm trying to set via c# code the formula of an excel cell. I use Microsoft.Office.Interop.Excel, version 14. I always get an excel error 0x800A03EC, which is a kind of generic error.
String formula = "=IF(A2=\"BLANCO\";\"\";C1+1)"
Range cell = (Microsoft.Office.Interop.Excel.Range)ws.Cells[2, 3];
cell.Formula = formula;
I also tried to escape the double quotes with an @
String formula = @"=IF(A2=""BLANCO"";"""";C1+1)"
Same error, same problem.
When I try to set a simple formula, where no quotes are involved it is working fine.
Anybody has a solution?
@"=IF(A2=""BLANCO"","""",C1+1)"
(commas not semicolons)? – D Stanley