VBA-Function for Dialog-Box to select elements

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • VBA-Function for Dialog-Box to select elements

    Hi here

    is there a vba-function to start the dialogbox to select 1 (or more elements) of a dimension (simular to "palo.ename(...) as an excel-sheet formula), to produce a list of one or more (selectet elements) in vba

    thank's a lot for help, it's urgent
  • RE: VBA-Function for Dialog-Box to select elements

    Hi,

    (you have to set a vba reference to jedox.palo.xladdin.tlb first)
    id
    solution for selecting one element:

    Source Code

    1. Sub VBAChooseElement()
    2. Dim returnvalue As Variant
    3. Dim obj As Jedox_Palo_XlAddin.IPaloEngineCom
    4. Set obj = New Jedox_Palo_XlAddin.ComInterface
    5. returnvalue = obj.ChooseElements("localhost/Demo", "Products")
    6. MsgBox (returnvalue)
    7. End Sub



    solution for selecting one or more elements:

    Source Code

    1. Sub VBAChooseElements()
    2. Dim returnvalue As Variant
    3. Dim obj As Jedox_Palo_XlAddin.IPaloEngineCom
    4. Set obj = New Jedox_Palo_XlAddin.ComInterface
    5. returnvalue = obj.ChooseElementsEx("localhost/Demo", "Products", True, "") '"" could be an attribute name
    6. MsgBox (returnvalue(0)) 'first selected
    7. End Sub
    Display All


    Holger

    The post was edited 2 times, last by h_decker ().

  • John,
    you can paste the first section of the code

    Source Code

    1. Sub Test()
    2. Dim returnvalue As Variant
    3. Dim obj As Jedox_Palo_XlAddin.IPaloEngineCom
    4. Set obj = New Jedox_Palo_XlAddin.ComInterface
    5. ....


    Then type "obj." within that sub
    and you can see some other available functions of the tlb.

    In general you can use the PALO worksheet functions by using e.g.
    Application.Run("PALO.DATA","lochost/Demo","Sales",.....

    Some of the functions, like PALO.EADD and ERENAME need a

    Application.Run("PALO.ENABLE_LOOP", True)

    before they can work and

    Application.Run("PALO.ENABLE_LOOP", false) after this.

    Another interessting function is
    =PALO.REGISTER("myConn","127.0.0.1",7777,"admin","admin") or
    application.run("PALO.REGISTER","myConn","127.0.0.1",7777,"admin","admin")

    This registers a server connection in current excel session. So that you can use it in the worksheet functions as e.g. myConn/Demo.

    Holger

    The post was edited 1 time, last by h_decker ().

  • OK - I tried to add an element

    Sub AddProduct()

    ReturnCode = Application.Run("PALO.ENABLE_LOOP", True)
    ReturnCode = Application.Run(PALO.EADD, "localhost/Range", "Product_Option", "n", "New Option 1", "All Options", 1, FALSE)
    ReturnCode = Application.Run("PALO.ENABLE_LOOP", False)

    End Sub

    This fails with Run Time error 424 - Object Required.

    Can anyone tell me what I am doing wrong there?

    EDIT - Funny how as soon as you post you notice the missing quote marks around the PALO.EADD that have been staring you in the face for 10 minutes :) Sorry :baby:
    Best wishes

    John Hobson
    The Planning Factory, Lytham, UK
    www.planfact.co.uk

    The post was edited 1 time, last by Pommie ().