J
John Daintree
Hello All,
I have a problem when I load an Excel 2007 (.xlsx) file into Excel 2007 over
the COM interface. The file was saved with an Italian version of Excel. I am
using Excel.Workbooks.Open to load the file into the same (Italian, same
machine, same user), version of excel. The problem is that a number of
settings in the file are lost when the file is loaded this way.
If I start Excel from the desktop and load the file from the menu the
settings are maintained.
I've written a trivial C# application (code follows signature) that uses
COM to load the file, and the settings are lost and/or changed.
The specific settings that I am losing are related to the "Print Titles"
setting.
1) The "Rows to repeat at top" setting which was set via "Page
Layout->Sheet->Print Titles".
After loading the file via COM the dialog box field is empty.
2) In Formulas->Name Manager.
The only name in the list has been translated from the Italian "Titoli
stampa", into the English "Print Titles"
I suspect that some locale information is lost across the COM interface. How
can I ensure that the italian nature of the file is maintained?
Thanks,
John.
C# code:
private void button1_Click(object sender, EventArgs e)
{
Excel.Application ex = new Excel.Application();
Object m = Type.Missing;
ex.Visible = true;
ex.Workbooks.Open(textBox1.Text, m, m, m, m, m, m, m, m, m, m,
m, m, m, m);
}
I have a problem when I load an Excel 2007 (.xlsx) file into Excel 2007 over
the COM interface. The file was saved with an Italian version of Excel. I am
using Excel.Workbooks.Open to load the file into the same (Italian, same
machine, same user), version of excel. The problem is that a number of
settings in the file are lost when the file is loaded this way.
If I start Excel from the desktop and load the file from the menu the
settings are maintained.
I've written a trivial C# application (code follows signature) that uses
COM to load the file, and the settings are lost and/or changed.
The specific settings that I am losing are related to the "Print Titles"
setting.
1) The "Rows to repeat at top" setting which was set via "Page
Layout->Sheet->Print Titles".
After loading the file via COM the dialog box field is empty.
2) In Formulas->Name Manager.
The only name in the list has been translated from the Italian "Titoli
stampa", into the English "Print Titles"
I suspect that some locale information is lost across the COM interface. How
can I ensure that the italian nature of the file is maintained?
Thanks,
John.
C# code:
private void button1_Click(object sender, EventArgs e)
{
Excel.Application ex = new Excel.Application();
Object m = Type.Missing;
ex.Visible = true;
ex.Workbooks.Open(textBox1.Text, m, m, m, m, m, m, m, m, m, m,
m, m, m, m);
}