That's a bug of Excel. See:
BUG: "Old Format or Invalid Type Library" Error When Automating Excel
http://support.microsoft.com/kb/320369/en-us
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
Julia said:
This is the code:
--------------------------------------------------------------
System.Globalization.CultureInfo myNewCulture = new
System.Globalization.CultureInfo("en-US");
objSheet = new Excel._Worksheet[1];
string[] sheetNames = {"ETT"};
string[][] allRowNames = new string[][]{ new string[]{"FirstRow"} };
objApp = new Excel.Application();
objApp.UserControl = true;
Object oBooks = objApp.Workbooks;
oBooks.GetType().InvokeMember("Add",
System.Reflection.BindingFlags.InvokeMethod, null, oBooks, null,
myNewCulture);
objApp.Save("C:\\Documents and Settings\\junorman\\Desktop\\text.xls");
--------------------------------------------------------------
- I have my regional options set to Swedish.
- The code fails at objApp.Save
- The error message is: {"Old format or invalid type library." }
- If I remove the first row and send in my CurrentCulture to the
oBooks.GetType()... this row will fail.
Is there anything special one needs to do to be able to work with Excel
when
using regional option set to Swedish.
Thank you for spending time on this problem
Julia