Create COM DLL in 2005 and use it in VB6.0 PowerPoint Application (Macro Enabled)

Posted on 2008-11-19
Last Modified: 2013-11-10
I have created a "COM interop" enabled DLL and TLB file in 2005 and used it in PowerPoint as a reference and it worked fine on the development machine. But on target machine which have .net framework 2.0 it did not worked. I opened the PowerPoint 2007 with security level LOW, and it showed me MISSING reference of the DLL. When I tried to add DLL file it showed me an error "Can't add reference to specif file". I was able to add the .TLB file as a reference and see the list of available functions in it. But when I executed the program it showed me "Automation Error".
<ComClass(Core.ClassId, Core.InterfaceId, Core.EventsId)> _

Public Class Core

Open in new window

Question by:Harry_Shan
    LVL 3

    Expert Comment

    I did something like this when I needed to use a .Net assembly in a classic ASP web site.  I put my DLL project on CodePlex which has instructions in a text file inside of the project:
     Here is the text from the documentation I left in that project on how to use it which I believe would apply here also:
    Installation Instructions
    1.)  Run the .Net Framework 'gacutil.exe' on the library file.  The gacutil.exe must be the version that is associated with
      the version of the framework that you compiled the library under:
      gacutil /i ComImpersonate.dll
    2.)  Run the assembly for COM.  I had to use the .Net Framework 2.0's version which worked for the 3.5 library:
      regasm /tlb ComImpersonate.dll
    LVL 3

    Expert Comment

    And, I'm guessing the reason that it worked on your development machine was because the IDE registered the library for you (that's my assumption anyway).

    Author Comment

    I tried using regasm command in RUN window.. it shows me this error screen.

    [Window Title]

    Windows cannot find 'regasm'. Make sure you typed the name correctly, and then try again.


    I'm using Windows Vista Ultimate 64 bit operating system. Will that be any problem? However, I've tried the same thing on a Windows XP system... and I got the same error.

    Author Comment

    Okay... I found it, I need to use Visual Studio Command Prompt. But how will I do this on client's PC which only have .net framework?
    LVL 3

    Accepted Solution

    That's a good question.  I actually had to copy it to the target machine (or rather, that was the quickest way I found to fix it).  It wasn't a problem for me because I was deploying it to a server and not to users workstations.  
    Now, check this location, it may exist on the client's machine if they have .Net installed:
    You have to user the version specific to the version of the framework you're using (3.0 & 3.5 use 2.0's regasm however, because 3.5 was built off of 2.0, or at least that's the way I've understood it).  In this cause, if it was in the above location you could write a batch file to shell it with the full path.
    LVL 3

    Expert Comment

    Check this link also, it has some good info:

    Author Closing Comment

    Thanks a lot for your help. I had deployed the application on my client's PC and it worked.

    Once again thanks for all your time and support.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    This video teaches viewers how to add transitions to their Slideshows and how to set up timing for the transitions.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now