+ Reply to Thread
Results 1 to 9 of 9

how to make a function defined in one workbook being called by other workbooks

  1. #1
    Registered User
    Join Date
    06-09-2008
    Posts
    7

    how to make a function defined in one workbook being called by other workbooks

    Hi All,

    I have defined a function in one of the workbook. This function works fine in this workbook. However when I try to execute the same function in the other workbook, it does not work since the function is not defined in the other workbook. How do I make this function defined in one workbook to work with any other workbook. I have defined the function as Public. I have also tried to define the function in the personal.xls file which gets loaded up every time MS Excel opens. But none of the solutions work.

    Any help would be greatly appreciated.

    Thanks,

    Anshul

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello anshul,

    It would be easier to answer your question if you posted the function.

    Sincerely,
    Leith Ross

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    It might be something as simple as referencing the ActiveWorkbook, as leith says we need to see the code.
    Hope that helps.

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

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    06-10-2008
    Posts
    10

    File is attached for Leith

    Dear Leith
    I have attached a file with macro of a function, so that you can give solution for me, and Anshul.

    Sincerely,
    The AD
    Attached Files Attached Files
    Last edited by The AD; 06-11-2008 at 03:09 AM.

  5. #5
    Registered User
    Join Date
    06-09-2008
    Posts
    7
    Attached is the spreadsheet that contains the function. Here is the function anyway:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by The AD
    Dear Leith
    I have attached a file with macro of a function, so that you can give solution for me, and Anshul.

    Sincerely,
    The AD
    Take the time to read the Forum Rules & you will see that you should not ask your question in another member's post. Post your own question.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Place your code in a new workbook and save it as an addin (*.xla).Excel will automatically save it to the addins folder. From the Tools menu select Addins & browse for your addin to complete installation

    The Function will then be available to any workbook.

  8. #8
    Registered User
    Join Date
    06-09-2008
    Posts
    7
    Thanks Roy. The solution works. Thanks all for the help.

    I really appreciate all your help.

    Anshul

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Glad it helped & thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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