• Excel Toolkit Functions

    Author
    Topic
    #354505

    How can I use Excel Toolkit Functions in VBA code. The Add-ins collection only allows you to load the Add-in, but the functions, such as NetWorkDays, don’t appear under WorkSheetFunction. Andy.

    Viewing 0 reply threads
    Author
    Replies
    • #521043

      If you are referring to the Analysis ToolPak Add-In, there is a special VBA version (Analysis ToolPak – VBA) which you should install. If you go to Tools,Add-Ins, you should see it, just just make sure the box is checked. You will notice in the function wizard that 2 versions of the AddIn functions appear, one in caps the other (VBA) in proper case.

      Hope that helps,

      Andrew C

      • #521108

        Although there is the VBA Toolkit Add-in, I need to know how to refer to the functions in my code. For example, Application.WorksheetFunction.NetWorkDays(…)?

        • #521130

          Try the Evaluate Method, e.g x = Evaluate(“NetworkDays(Now(),Now()+100)”), which can be shortened to x = [NetworkDays(Now(), Now()+100)].

          Hope that helps,

          Andrew

          • #521173

            Cheers, this works Ok. However, I feel sure I should be able to reference the function directly, without creating a string. The function must reside in the Funcres.xla Add-in, although I don’t know the name of the module. I’m look for something like ‘Workbooks(“funcres.xla”)…NetWorkDays(..)’?!

            • #521226

              Actually these functions are part of Atpvbaen.xla. Howe.ver there can be problems depending on the the version of XL you have.

              Check article Q165134 at Microsoft’s knowledge base, and see if it can help you to resolve the problem.

              Andrew C

            • #521352

              Sorted! I hadn’t included a Reference to Aptbean.xla. By including this the Toolkit functions appear in the Object Browser. I don’t then need to qualify the reference to the use the function(s). For example, ‘MsgBox Networkdays(Now(),Now()+10)’ works beautifully!! Cheers.

    Viewing 0 reply threads
    Reply To: Excel Toolkit Functions

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: