![]() |
Retrieving formulas property in Office System in Spanish
Hi everyone:
I'm having the following problem using .NET components with Office System. I'm using an Add-in in Excel, written in C#, but I'm having an unexpected behavior when it runs with Office System in Spanish In order to avoid language issues, I'm using the property FormulaR1C1 to retrieve formulas, which I expect to be always in English (R#C# instead of F#C# which is the format used in Spanish). When I use VBScript, VBA or VB 6.0, this is correct; but when I use C#, I'm getting the F#C# format, exactly the same value as when using the FormulaR1C1Local property For instance, the following VBScript Set x = GetObject(, "Excel.Application") Set y = x.WorkSheets(1) MsgBox y.Cells (1,1).FormulaR1C1 //Retur ns R4C4 MsgBox y.Cells (1,1).FormulaR1C1Local //Returns F4C4 But the equivalent code, written in C# Excel.Application excelApp = (Excel.Application) System.Runtime.InteropServices.Marshal.GetActiveOb ject ("Excel.Application"): Excel.Worksheet excelApp.Worksheets[1]; Excel.Range x = (Excel.Range)worksheet.Cells [1,1]; String s = x.FormulaR1C1.ToString (); //Returns F4C4 String b = x.FormulaR1C1Local.ToString (); //Returns F4C4 Am I doing something wrong? This is a known issue? How can I correct it? Regards Rodolfo |
All times are GMT +1. The time now is 09:54 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com