Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Sep 2001
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MakeCompiledFile (Office 2k English MUI)

    I found the method "MakeCompiledFile" while browsing my VBProject in Word's VBA Editor. According to the online help it should create a compiled dll out of my add-in file.
    However if I try to use the method I get a runtime error '748': Method or property is not valid in this type of project.

    The online help is not really helpfull and my web research ended fruitless as well. Since compiling the add-in would be a big progress for my project, I'm really interested what kind of projects are supported. Do you use this method and/or have any additional information for this method?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MakeCompiledFile (Office 2k English MUI)

    In Neither my Word 2K nor my XL2K this method is recognized by OLH.

    Maybe you have some reference set to another type lib that does contain that method?

    AFAIK Office add-ins cannot be compiled into a dll. The closest is a COM add-in.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Star Lounger
    Join Date
    Sep 2001
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MakeCompiledFile (Office 2k English MUI)

    MakeCompiledFile is available in my ObjectBrowser as soon as the reference to MS VBA Extensibility is set. So this seems to be a "regular" VBA-method. Still even a minimal "Hello World" module can not be compiled.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MakeCompiledFile (Office 2k English MUI)

    No, it is NOT a "regular" VBA method. You can only make a compiled file of a VB project, not any of the Office applications. Even setting the extensibility reference on my machine doesn't find that method, regardless of the application I am in. For that matter, I don't find it in VB either. You have something installed on your machine that is exposing that method, but it isn't a regular part of VB/VBA.
    Charlotte

  5. #5
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: MakeCompiledFile (Office 2k English MUI)

    If you set a reference to the "Microsoft Visual Basic 6.0 Extensibility" library (VBIDE), the MakeCompiledFile() method will be listed as a member of the VBIDE VBProject class. According to Object Browser, this method "Writes out the project as an .exe, DLL, or control, depending on the project type." This doesn't mean you can use this to compile a VBA project as an .exe or .dll file; if you can't do this in the VBA user interface - which you can't - trying to do so programatically via VBIDE won't work either. Recommend check this MSKB article:

    HOWTO: Build an Office 2000 COM Add-In in Visual Basic

    As article helpfully notes, "A COM Add-In is an inprocess COM server (an ActiveX DLL) that implements the IDTExensibility2 interface as described in the Microsoft Add-In Designer Type Library (Msaddndr.dll). " It states further there are 3 ways to build a COM Add-in, the easiest of which being, if you have MS Office 2000 Developer OR Office XP Developer AND Visual Basic 6.0 (Professional Ed), is to use the COM Add-in.vbp template which can be found on the Office Developer CD. Copy the project files to the VB98 ..TemplatesProjects folder. The template will then appear in the VB New Project dialog (see illustration). If you don't have Office Developer, you can still use the standard VB 6.0 Add-In designer (appears as "Addin" in New Project dialog).

    In any event you can't compile an add-in from a VBA project, you have to use VB, or, as noted in MSDN, "You can also develop COM add-ins for Office 2000 by using any application development environment that supports the creation of COM objects, such as Microsoft Visual C++

  6. #6
    Star Lounger
    Join Date
    Sep 2001
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MakeCompiledFile (Office 2k English MUI)

    Thanks a lot MarkD

    That was exactly the kind of information I was looking for. <img src=/S/joy.gif border=0 alt=joy width=23 height=23>
    I still don't get, why a method, that is not available, is displayed in the object browser. But who said, that computers are behaving logically anyway?

    I will install the Office developer version and VB on my machine and try this way of generating a COM-add-in.

    Thanks again for your help,
    hedgehog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •