Discussion:
Using a tlb file in VB 2010 project for Outlook
(too old to reply)
Sanjay
2010-09-16 00:25:49 UTC
Permalink
I am trying to use XL-Dennis'es tlb file as recommend in Professional
Outlook 2007 Programming (Ken Slovak) .

I tried to add the tlb file to VB in Vs2010 and got the error:

A reference to the <filename> could not be added.Please maje sure that
the file is accessible and it is a valid assembly or COM component.

I then tried tlbimp.exe on it and got the message:

TlbImp: error TI1000: The type library encountered an unexpected
exception: Sustem.IO.IOException - Access is denied. <Excpetion from
HRESULT:0x80070005 <E_AccessDENIED>>

I would love to get this working in VB2010.

What am I doing wrong?

Thanks
Sanjay
Ken Slovak
2010-09-16 13:51:14 UTC
Permalink
I haven't used Dennis's tlb with VS 2010, I mostly use that now for addins
written using unmanaged code.

What I use now with managed code is a set of ComImport's for the ribbon
interfaces. I use the model set up by Andrew Whitechapel, who used to be on
the VSTO team. That has allowed me to add the new interfaces exposed for
RibbonUI in 2010 for things such as ActivateTab.

The blog articles by Andrew about this use C# code, but it should be pretty
easily translated into VB.NET code. See
http://blogs.msdn.com/b/andreww/archive/2008/06/03/add-ins-for-multiple-office-versions-without-pias.aspx
for the first of the related articles.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by Sanjay
I am trying to use XL-Dennis'es tlb file as recommend in Professional
Outlook 2007 Programming (Ken Slovak) .
A reference to the <filename> could not be added.Please maje sure that
the file is accessible and it is a valid assembly or COM component.
TlbImp: error TI1000: The type library encountered an unexpected
exception: Sustem.IO.IOException - Access is denied. <Excpetion from
HRESULT:0x80070005 <E_AccessDENIED>>
I would love to get this working in VB2010.
What am I doing wrong?
Thanks
Sanjay
Sanjay
2010-09-16 23:12:06 UTC
Permalink
Thanks Ken... looks a little too complicated for me at this stage... I
may need to support the different versions manually for a while.

Sanjay
Post by Ken Slovak
I haven't used Dennis's tlb with VS 2010, I mostly use that now for addins
written using unmanaged code.
What I use now with managed code is a set of ComImport's for the ribbon
interfaces. I use the model set up by Andrew Whitechapel, who used to be on
the VSTO team. That has allowed me to add the new interfaces exposed for
RibbonUI in 2010 for things such as ActivateTab.
The blog articles by Andrew about this use C# code, but it should be pretty
easily translated into VB.NET code. Seehttp://blogs.msdn.com/b/andreww/archive/2008/06/03/add-ins-for-multip...
for the first of the related articles.
--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm
Post by Sanjay
I am trying to use XL-Dennis'es tlb file as recommend in Professional
Outlook 2007 Programming (Ken Slovak) .
A reference to the <filename> could not be added.Please maje sure that
the file is accessible and it is a valid assembly or COM component.
TlbImp: error TI1000: The type library encountered an unexpected
exception: Sustem.IO.IOException - Access is denied. <Excpetion from
HRESULT:0x80070005 <E_AccessDENIED>>
I would love to get this working in VB2010.
What am I doing wrong?
Thanks
Sanjay
Ken Slovak
2010-09-17 15:35:40 UTC
Permalink
It must be something about 2010, I just played with new shared addin
projects in VS 2005 and VS 2008 and I was able to just reference Dennis's
tlb with no problems. All I did was Browse to the location of the tlb.

Are you using Framework 4 with your project? Everywhere I've used Dennis's
tlb in managed code I've used it with Framework 2 (or even with 1.1).

Usually after I do a compilation I get a PIA created for the tlb, I usually
change my reference to that after the initial compilation and I deploy the
created PIA with my project.

Doing it that way provides a strong named PIA as long as I have my addin
project also strong named.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanjay" <***@gmail.com> wrote in message news:26130a62-1f76-4705-860e-***@q16g2000prf.googlegroups.com...
Thanks Ken... looks a little too complicated for me at this stage... I
may need to support the different versions manually for a while.

Sanjay
Sanjay
2010-09-19 21:17:21 UTC
Permalink
I was using Framework 3.5. Changed it to 2.0 and still got the same
error.

Thanks
Sanjay
Post by Ken Slovak
It must be something about 2010, I just played with new shared addin
projects in VS 2005 and VS 2008 and I was able to just reference Dennis's
tlb with no problems. All I did was Browse to the location of the tlb.
Are you using Framework 4 with your project? Everywhere I've used Dennis's
tlb in managed code I've used it with Framework 2 (or even with 1.1).
Usually after I do a compilation I get a PIA created for the tlb, I usually
change my reference to that after the initial compilation and I deploy the
created PIA with my project.
Doing it that way provides a strong named PIA as long as I have my addin
project also strong named.
--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm
Thanks Ken... looks a little too complicated for me at this stage... I
may need to support the different versions manually for a while.
Sanjay
Ken Slovak
2010-09-20 17:16:44 UTC
Permalink
I was unable to directly add a reference to Dennis's tlb in a VS2010 shared
addin project.

However, I was able to use a workaround. I took the XLIRibbonExtensibility
PIA from an existing project to the tlb and was able to reference the PIA.
The PIA is created automatically for you. So if you have a copy of that just
reference that instead of referencing the tlb directly.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanjay" <***@gmail.com> wrote in message news:635de1e2-7c8a-431e-baa3-***@e34g2000prn.googlegroups.com...
I was using Framework 3.5. Changed it to 2.0 and still got the same
error.

Thanks
Sanjay
Sanjay
2010-09-20 22:56:37 UTC
Permalink
Hi Ken

Thank you for persisting with this for me.

I am not sure what you mean by " I took the XLIRibbonExtensibility PIA
from an existing project to the tlb".

Thanks
Sanjay
Post by Ken Slovak
I was unable to directly add a reference to Dennis's tlb in a VS2010 shared
addin project.
However, I was able to use a workaround. I took the XLIRibbonExtensibility
PIA from an existing project to the tlb and was able to reference the PIA.
The PIA is created automatically for you. So if you have a copy of that just
reference that instead of referencing the tlb directly.
--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm
I was using Framework 3.5. Changed it to 2.0 and still got the same
error.
Thanks
Sanjay
Ken Slovak
2010-09-21 13:40:16 UTC
Permalink
When you use Dennis's tlb in a managed code application a PIA is created for
it (Interop.XLIRibbonExtensibility.dll). If you have projects created using
an older version of VS that used the tlb get the PIA from one of those
projects and add it to your VS2010 project and it should work just fine.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanjay" <***@gmail.com> wrote in message news:db4d8b1b-48e6-4f34-9363-***@e34g2000prn.googlegroups.com...
Hi Ken

Thank you for persisting with this for me.

I am not sure what you mean by " I took the XLIRibbonExtensibility PIA
from an existing project to the tlb".

Thanks
Sanjay
Loading...