Office 2003 PIA Problems

Office 2003 PIA Problems

Post by RGllZ2 » Tue, 19 Oct 2004 18:47:36


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.
Moreover I checked my code against MSDN samples and I re-installed MS Office
PIAs to be sure.
Do you know why I get that error? How can I solve it?

Thank you

Diego
 
 
 

Office 2003 PIA Problems

Post by RGllZ2 » Tue, 19 Oct 2004 19:19:05

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

 
 
 

Office 2003 PIA Problems

Post by RGllZ2 » Tue, 19 Oct 2004 20:31:02

I'm really sorry about duplicated post. My connection seemed down

Diego
 
 
 

Office 2003 PIA Problems

Post by v-phuan » Wed, 20 Oct 2004 11:25:57

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://www.yqcomputer.com/ ;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://www.yqcomputer.com/ ;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.
 
 
 

Office 2003 PIA Problems

Post by v-phuan » Wed, 20 Oct 2004 11:30:01

Hi

I reviewed the thread and find that there is a similar issue in the
newsgroup below.Now our colleague has replied to you, you may go and take a
look.
Subject: Office 2003 PIA Problems
Newsgroups: microsoft.public.office.developer.automation


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.
 
 
 

Office 2003 PIA Problems

Post by RGllZ2 » Wed, 20 Oct 2004 15:31:01

Thank you very much for your suggestion!
That KB solved the issue...

Regards

Diego
 
 
 

Office 2003 PIA Problems

Post by v-phuan » Wed, 20 Oct 2004 21:11:02

Hi

I am glad that works!
Cheers!:)

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.