Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi,

 

this might be a dumb question.... but i can't open a workbook from c#...

i have already insert the COM reference into the project, it was the MS Excel 11.0 Object Library, TypeLib-Version 1.5.

my code looks like this :

			object oMissing = Type.Missing;
		Excel.Application oApp = new Excel.ApplicationClass();
		Excel.Workbook oWB;
		Excel.Worksheet oWS;	

		oWB = oApp.Workbooks.Open(@"myxlfile.xls", 
			oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
			oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);

it says : "Old Format or Invalid Type Library" on the Workbooks.Open part....

 

if i write Excel.Application oApp = new Excel. and press ctrl+space i could select _Application too, but it is an interface.... and there is no Application too...

 

Any suggestions to get it right? thx :)

Posted
i found the source of the problem. The Problem is that i have a german version of windows and english version of office. I read a microsoft's site about this problem and it says if the local settings' language and the office language aren't the same, excel will try to locate a suitable MUI. if excel doesn't find it, it will throw this exception...
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...