+ Reply to Thread
Results 1 to 7 of 7

To use DLLs or Add-Ins ?

Hybrid View

  1. #1
    Registered User
    Join Date
    06-05-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    5

    To use DLLs or Add-Ins ?

    Hi,

    I have some VBA code which extensively reference the cells in the workbook where it resides. I need to distribute the code so that the users can call my macros from their spreadsheets. I've done this by creating an Add-In out of that workbook.
    Would creating a DLL out of this code be of any advantage? (My functions will only be called from an Excel spreadsheet) Also, can the functions inside a DLL, reference any workbook cells?

    Thanks
    Last edited by abhimanyut; 06-08-2009 at 06:18 AM. Reason: SOLVED

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: To use DLLs or Add-Ins ?

    An addin would be fairly straightforward, but you code will need to reference the correct workbook not the one holding the code. Use Activeworkbook, not ThisWorkBook.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-05-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: To use DLLs or Add-Ins ?

    Yes, I've handled workbook referencing carefully. My question is, are there any advantages of using DLLs over Add-Ins (given that I'll only be calling my functions from another excel spreadsheet) and secondly, is it even possible for DLL functions to access any workbook cells for their calculation, data storage etc. ?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: To use DLLs or Add-Ins ?

    You can't create a dll from Excel, you would need to use another pogram such as VB Net, addins can be created directly from Excel.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: To use DLLs or Add-Ins ?

    If you're good with C you could compile as .xll (faster)...

    http://support.microsoft.com/kb/178474

  6. #6
    Registered User
    Join Date
    06-05-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: To use DLLs or Add-Ins ?

    Thanks for the help guys! For this time I'll go with an add-in only, but thanks for the C suggestion.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: To use DLLs or Add-Ins ?

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1