Here is something weird that is happening to me and I just cannot seem to fix
this problem:
I have built an application that does a data dump into Excel and then
creates named ranges so that the user can easily link to the data.
I am using the latest PIAs for Office (v.10.0) and everything works fine
when I am running the application using an English version of Excel.
When I am running with the French version of Excel I just cannot add a
ranged name in Excel. The application does not crash but it simply removes
the named range from Excel and does nothing...
Here is the code I use in order to add the ranged name that works in ENG
Excel 2002:
public void AddName( string Name, int iRowStart, int iColStart, int iRowEnd,
int iColEnd, Microsoft.Offic e.Interop.Excel .Worksheet sht, Workbook wbk )
{
string addr = "=" + sht.Name + "!R" + iRowStart.ToStr ing() + "C" +
iColStart.ToStr ing() + ":R" + iRowEnd.ToStrin g() + "C" + iColEnd.ToStrin g();
wbk.Names.Add( "__" + Name, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, addr, Type.Missing );
}
Thanks,
JS
this problem:
I have built an application that does a data dump into Excel and then
creates named ranges so that the user can easily link to the data.
I am using the latest PIAs for Office (v.10.0) and everything works fine
when I am running the application using an English version of Excel.
When I am running with the French version of Excel I just cannot add a
ranged name in Excel. The application does not crash but it simply removes
the named range from Excel and does nothing...
Here is the code I use in order to add the ranged name that works in ENG
Excel 2002:
public void AddName( string Name, int iRowStart, int iColStart, int iRowEnd,
int iColEnd, Microsoft.Offic e.Interop.Excel .Worksheet sht, Workbook wbk )
{
string addr = "=" + sht.Name + "!R" + iRowStart.ToStr ing() + "C" +
iColStart.ToStr ing() + ":R" + iRowEnd.ToStrin g() + "C" + iColEnd.ToStrin g();
wbk.Names.Add( "__" + Name, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, addr, Type.Missing );
}
Thanks,
JS