Hi Peter,
I found the solution to my problem. There was nothing wrong with my code,
not even with the PIA stuff.
The only problem was that I my Regional Settings were not "en-US" but
something else.
This problem was due to a Microsoft BUG (check KB article 320369).
As a work around, I borrowed some code from the above article:
// Save cultural settings in oldCI var and set the settings to "en-US"
System.Globalization.CultureInfo oldCI =
System.Threading.Thread.CurrentThread.CurrentCulture;
System.Threading.Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo("en-US");
... call methods and properties using interop
// Restore the original cultural settings.
System.Threading.Thread.CurrentThread.CurrentCulture = oldCI;
The funny thing is that this work around works for both the early and late
binding. The problem with the
late binding was that I did not receive the "Old format or invalid type
library" message.
Thank you all
I consider this thread closed.
Emmanuel
[quoted text, click to view] "Emmanuel" <Emmanuel@newsgroup.nospam> wrote in message
news:%23SHEwmE2EHA.2644@TK2MSFTNGP11.phx.gbl...
> Hi Peter,
>
> I performed the test with the KB article 302902 without changing a single
> line. The only thing that might be different from the article is that when
> I am
> adding the reference, from the COM tab I select: "Microsoft Excel 11.0
> Object Library" that has TypeLib Version 1.5.
> When I select this reference, another reference with the name "VBIDE"
> appears in the list of my project's references.
>
> I execute the sample code and when I press the button I get the message:
> "Error: Old format or invalid type library. Line:
> Microsoft.Office.Interop.Excel
>
> Do you have any idea what is happenning here ?
>
> Thank you
> Emmanuel
> ""Peter Huang" [MSFT]" <v-phuang@online.microsoft.com> wrote in message
> news:GugziKB2EHA.3388@cpmsftngxa10.phx.gbl...
>> Hi
>>
>> Yes, it seems that the office 2003 PIA has been installed.
>> Have you tried to set the property using early binding?
>> Did that work for you?
>> Also I think you may try to follow the KB article to write a simple test
>> application to see if there is any problem?
>>
>> Please perform the test so that we can isolate the problem, thanks.
>>
>>
>> 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.
>>
>
>
>