This project has moved. For the latest updates, please go here.

Beginner question PowerPoint addin

Oct 28, 2013 at 4:56 PM
Hi all,
after having used the fantastic NetOffice library for a while to process Excel data, I'd like to start using it to have a PowerPoint addin.
I'd like to create a PowerPoint addin that the user needs to install manually (so no registration desired from my side).
If needed, there can be a classic PowerPoint VBA Addin that calls the .Net code like a wrapper.
I am a beginner in this field so I would like to ask how to start with this.
I found in the source code several COM Examples for PowerPoint but they try to register themselves when I compile them.
So is there anybody who can show me a simple "Hello World" example how I need to create a PowerPoint Addin that calls a sample .net method?

Thanks a lot in advance,
Thomas
Coordinator
Oct 28, 2013 at 6:06 PM
Edited Oct 28, 2013 at 6:07 PM
not sure what you mean. you want call some .net code or addin from vba? (it's possible)
btw: a COMAddin needs always a registration(regardless from VB(6) or .net or C++). the first registration is during while regasm.exe is processing and make sure the com component is visible in the local machine. anyone can use these component now. you can use a simple msi deployment project to deploy and register your addin. the second (manualy) registering want create the specific office addin keys for your addin. this is not necessary if users select the Addin in the COMAddins dialog and click okay.
Oct 29, 2013 at 6:54 AM
Hi,
thanks for the fast reply.
I am sorry I caused confusion: actually I don't want to use a COMAddin, it should be a PowerPoint Addin (.ppam) that contains a function which calls a method of a .Net library. So is this possible and if yes how?

Thanks in advance,
Thomas
Coordinator
Oct 29, 2013 at 4:34 PM
you need a reference to mscoree.tlb

Dim CORHost As New mscoree.CorRuntimeHost
Dim Domain As AppDomain
Set a = Domain.CreateInstanceFrom("C:\myAssembly.dll", "MyNamespace.MyClassName").Unwrap

' call a void HelloWorld() method in the .net assemby class
a.HelloWord()
Oct 30, 2013 at 10:41 AM
Edited Oct 30, 2013 at 12:23 PM
Great idea, thanks a lot. I used your code and built a simple .net library, but I got always a Runtime 91 error all the time ;-)
But i checked further and found something similar here:
Call .Net DLL in VBA without registration
But it's not possible to use .Net 4 / 4.5 libraries though...which is a killer for me.
For Excel I found the Excel DNA project which is together with NetOffice very powerful, it creates an XLL file with all the .Net Stuff and can be referenced by Excel directly (so no VBA wrapper code needed).
Unfortunately PowerPoint itself doesn't seem to have a similar functionality, I can only add ppa / ppam files.

Are there any other possibilities (maybe there is a new feature of .net 4.5)?

Thanks and best regards,
Thomas