Office 2003 PIA Problems

D

Diego

Hello,
I'm using VS.NET2003 with Office 2003 PIA installed to automate MS Excel.
When I run the following class

using System;
using Excel = Microsoft.Office.Interop.Excel;
using System.Reflection;


namespace StatisticReader
{
public class ExcelExporter
{
private Excel.Application app;
private Excel.Workbook wb;

public ExcelExporter(string textStats)
{
app = new Excel.ApplicationClass();
app.Visible = true;

wb = app.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet);
}
}
}

I get this error:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in StatisticReader.exe

Additional information: Old format or invalid type library.

I checked the reference properties and it point to the actual PIA :
Microsoft.Office.Interop.Excel.dll in the GAC. I checked the code against
MSDN samples and I installed again MS Office just to be sure.
Do you know why I get that error? How can I solve it?

Thank you

Diego
 
P

Peter Huang

Hi Diego,

The problem seems to be similar with the problem described in the KB below.
BUG: "Old Format or Invalid Type Library" Error When Automating Excel
(320369)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;320369

Also here is a KB article you may take a look.
INFO: Develop Microsoft Office Solutions with Visual Studio .NET (311452)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;311452

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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