Consulting

Results 1 to 9 of 9

Thread: COM add-in as a DLL in VBA

  1. #1
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location

    COM add-in as a DLL in VBA

    I have been really interested in the com add in idea since I heard about it here, So Using office 2000 developer I have created a com addin which saves as a DLL file.

    Having done this (And was until now feeling pretty pleased i actually managed it) I now have no idea how i can access the dll file to use it in my application?

    I ve tried reading some of the Microsoft stuff etc but still cant find the answer

    Can anyone here tell me how (Or where) to start and where i can read up on the subject in more detail please as its driving me nuts at the moment

    Im sure im probably missing something straightforward here

    Thanks

    Gibbo

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Wouldn't you just create a reference to it in Tools>References...?

  3. #3
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location
    Thanks Norie,

    didnt even realise that was how to get to it,

    next question is that my add in contains a userform, how can i open it or is this sort of thing not possible with a com addin?

    Also found this link which is of interest re getting to the addin

    http://www.officearticles.com/misc/h...plications.htm

  4. #4
    VBAX Mentor XL-Dennis's Avatar
    Joined
    May 2004
    Location
    ?stersund, Sweden
    Posts
    499
    Location
    Hi,

    I believe that Mark007 nice article will be of great interest for You:

    http://www.thecodenet.com/articles.php?id=38

    Kind regards,
    Dennis
    Kind regards,
    Dennis

    ExcelKB | .NET & Excel | 2nd edition PED


  5. #5
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location
    Thanks Dennis, that does take me one step nearer, but i am still unsure if and how i can call a userform that is contained within a com addin,

    Any help really appreciatted as this really is bugging me

    Cheers

    Gibbo

  6. #6
    VBAX Mentor XL-Dennis's Avatar
    Joined
    May 2004
    Location
    ?stersund, Sweden
    Posts
    499
    Location
    Gibbo,

    Userforms are usually launched via commandbutton or menu options and since we can create both these control I wonder what You have in mind when You raise the question.

    The menu option as well as toolbar where commandbuttons reside are created within the COM add-in.

    Kind regards,
    Dennis
    Kind regards,
    Dennis

    ExcelKB | .NET & Excel | 2nd edition PED


  7. #7
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location
    Thanks for the reply

    So am I right in thinking I can add a button to a menu and use that to call a form hidden within a com addin?

    I have a few ideas of how i would like to use this ibut am really learning the possibilities at this stage hence the question, My main reason is to be able to hade my code from my users in as secure a method as possible.

    In my searching for a way of making my code more secure I did find the following that may interest a few people here

    http://www.mrexcel.com/board2/viewto...ight=com+addin

    Gibbo

  8. #8
    VBAX Mentor XL-Dennis's Avatar
    Joined
    May 2004
    Location
    ?stersund, Sweden
    Posts
    499
    Location
    Hi Gibbo,

    So am I right in thinking I can add a button to a menu and use that to call a form hidden within a com addin?
    Absolutely and that's why I pointed You to Mark007's article

    Creating COM add-ins is the best way if we want to fully protect the code. However, as You have noticed it also require much more of us then creating regular Excel add-ins.

    Anyway, please continue to ask Your questions

    Kind regards,
    Dennis
    Kind regards,
    Dennis

    ExcelKB | .NET & Excel | 2nd edition PED


  9. #9
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location
    Thanks Denis

    Moving ahead of myself a bit, what I ultimately want is to have a menu item and when clicked it enables a set of userforms hidden in the com addin that will then use the excel sheets to store data in (kinda small database), would also hide excel from view, so my users have to interact with excel via the userforms i ve created.

    When the forms are closed it will save the workbook and data, so my users cannot manipulate the data and excel remains hidden throughout.

    When the saved workbook is re opened you would be taken straight to the userforms and excel is hidden again as above.

    I can and have already done this using vba in excel,

    But my question is if i used a com addin would I need to get the addin to create the relivent code and create the forms within the workbooks vba (And therefor loose my hidden code and the reason for a com addin in the first place), or can it reference the hidden forms and code within the com addin some how?

    I assume as I can get a userform to display via a button on my menu the above is not impossible, or am I trying to push things a bit too far?

    Cheers

    Gibbo

Posting Permissions

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