Can't open Workbook...(Excel 2003 and C# Visual Studio 2005)

G

Guest

Hi

I've done a lot in Excel Automation in prior C# and VB.Net Versions...but
I've no chance just to open an Excel Workbook with Visual Studio 2005. I've
go always these HRESULT-Failures...:-(

Thanks for your help...

Here's one of the code trials:

using Office = Microsoft.Office.Core;
using Excel = Microsoft.Office.Interop.Excel;
......
Excel.Application ObjExcel;
Excel.Workbook ObjExcelBook;
Excel.Worksheet ObjExcelSheet;

ObjExcel = new Excel.Application();
ObjExcel.Visible = true;


ObjExcelBook = ObjExcel.Workbooks.Open(@"C:/TMP/Test.xls", false,
true,

Type.Missing,Type.Missing,Type.Missing ,Type.Missing ,
Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing,
Type.Missing, Type.Missing, Type.Missing);
 
G

Guest

You're right....hmmm....I've set the Culture info in the old projects always
in a global load section too....:)

System.Threading.Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo("en-US");
System.Threading.Thread.CurrentThread.CurrentUICulture = new
System.Globalization.CultureInfo("en-US");

Thanks....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top