Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How can we pilot business object by Excel VBA ?

Hello everyone !

The titlle is pretty explicit but to completing in few words my need, I would like to pilot Busines Object XI (or deski) by a macro excel (VBA). More precisely, I need to :

-open a request

-refresh the datas

-extract the results in another excel document

Anyone has a code which allow this things ?

Thanks a lot in advance

Regards,

Clément

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Bonjour à tous,

Même si le titre est assez explicite, je vais compléter ma demande. J'aimerai depuis une macro excel pouvoir piloter l'apllication BO XI. Plus précisement, j'aimerai pouvoir :

-ouvrir une requête

-la rafrachir

-extraire les données

Quelqu'un connait-il un code VBA permettant cela ?

D'avance, merci beaucoup

Cordialement,

Tags:
replied

Hi

hope this will helpfull to you

'Get logon info for BOXI

    lstrUser = GetPassword("XXXX")

    lstrPass = GetPassword("XXXX")

    lstrPass = IIf(UCase$(lstrPass) = "NULL", "", lstrPass)

    lstrCMS = GetPassword("XXXX")

   

    'Create a Business Objects session and log in to it.

    AppXLDisplayAlerts = appXL.DisplayAlerts

    appXL.DisplayAlerts = False

   

    Set appBO = CreateObject("BusinessObjects.Application.11")

    appBO.Interactive = False

    StatMsg "Log on to BO session..."

    On Error GoTo bo_refresh_fail

    appBO.Logon lstrUser, lstrPass, lstrCMS, "secEnterprise", 0, 0

    appBO.Interactive = True

    appBO.Visible = True

    'appBO.Window.State = boMinimized

   

    '**Refresh the  report and save as Excel

   

    'Open the report which is kept in the same directory as this code filled treat of a workbook; making sure that the main tab is active

    StatMsg "Open report abc.rep..."

    Set docBO = appBO.Documents.Open(lstrLocation & "abc.rep")

    docBO.Reports("Summary Report").Activate

   

    'Now create the required parameters for the refresh

    docBO.Variables.Item("Period").Value = XXX

    docBO.Variables.Item("Project Code (%)").Value = XXX

    'Now  refresh

    StatMsg "Refresh report abc.rep..."

    appBO.Interactive = False

    docBO.Refresh

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question