VBA in Bex Analyzer

Dear Experts,
I'm running a BI query to extract data then used VBA code to import external data from another Excel file.  After storing the external data in a variable, I'm having trouble getting back to my original worksheet using VBA command Windows("Step Pricing Query.xlsm").activate.
Query Name: Step Pricing Query
Workbook Name:  Step Pricing Query.xlsm
I've checked the spelling and the file extension.  It doesn't seem to work.  I'm doing something wrong or my method is incorrect?  Your help is appreciated.
Thanks,

resolved.

Similar Messages

  • Vba on bex analyzer 7.0 to block cells

    hi gurus
    i have a workbook that contains 6 queries for planning, i need to block the cells that are not for planning, i mean characteristic row values so the user is not allowed to edit, just edit the key figures columns, i guess i have to write some vba code to achieve this, someone has done this before? any suggest?
    regrads
    joker

    Is there a reason you cannot simply pre-set the Excel Protection for those columns ? If you wanted to use VBA to set the protection for those cells, you could.

  • The BEx Analyzer cannot generate VBA code due to the security settings

    Hello experts,
    when I try to open a query in BEx Analyser I get this error message for each Item of the Query:
    Diagnosis
    The BEx Analyzer cannot generate VBA code due to the security settings.
    System Response
    VBA code is not generated.
    Procedure
    Choose Tools -> Macro -> Security.
    On the Trusted Publishers tab page, select Trust access to Visual Basic project.
    Choose OK.
    Close the BEx Analyzer and continue working as before.
    Access to Visual Basic project is only needed when generating VBA code.
    This only takes place in design mode or when 3.x workbooks are upgraded.
    Of course I did exactly what was recommanded in the "procedure-section" of this error message. But BEx ist still not working!
    I use SAP NetWeaver 7.0 together with MS Excel 2007
    Thanks
    Axel

    Hello experts,
    I am an additional person interested in the way this issue was solved.
    I confirm that the issue is coming from the SP2 of Microsoft Office (I have another environnement without the SP2 and everything works well), and I am in a situation where I can't remove the update.
    Regards
    Guillaume P.
    EDIT :
    Solution found : I applied the bi710sp10p_1001-10004472.exe patch
    (downloaded via the download maanger : Support Packages and Patches - Entry by Application Group" SAP Frontend Components" BI ADDON FOR SAP GUI" BI 7.0 ADDON FOR SAP GUI 7.10)
    Edited by: GUILLAUME PETIAUX on Apr 13, 2010 10:29 AM

  • Add own VBA Addin (.xla) to BEx Analyzer

    Hi,
    I created an XLA add-in, which I activated in my Office Excel. When opening Excel my add-in works fine (I can see it in my VB-Editor below BExAnalyzer.xla and it is possiblöe to use the makros.
    Unfortunately this add-in is not aktivated when opening BEx Analyzer. In this case the new add-in is not listed below the BExAnalyzer.xla, whereas it is marked to be active at the office options Special / Add-ins (extras / Add-dins in german office version).
    Office 2003
    BEx Front End Patch 501
    Does anybody know, how to implement own xla add-ins to BEx Analyzer?
    Best Regards,
    Helge

    I guess it's because of the way the BExAnalyzer loads Excel - it's an OLE call or something alike. In other words Analyzer loads BEx addin alone. I see two possible workarounds.
    One is to find some command line parameter for BExAnalyzer.exe to make it load the addin you want. The problem is I do not know if there are any such parameters.
    The other way is to load the addin after the BExAnalyzer.xla is loaded. You can easily check this way by opening your addin manually. However, doing it programmatically becomes a problem since the only piece of VBA code loaded is BExAnalyzer.xla itself. Therefore you have to modify BExAnalyzer.xla to load the stuff you want when it's opened by BExAnalyzer.exe. But it may be (and I'm sure it is) prohibited by the license agreement and by the way you will lose this file's digital signature trying to save the modified BEx addin (don't hesitate to make the backup first).
    This is the code to insert to ThisWorkbook module of BExAnalyzer.xla if you dare:
    Private Sub Workbook_Open()
        On Error Resume Next
            Application.Workbooks("YourAddin.xla").Saved = Application.Workbooks("YourAddin.xla").Saved
            ' If YourAddin.xla addin is not loaded (and we get an error in the line above), then open it
            ' and run addin automacros because the event doesn't fire when opening addin this way:
            If Err.Number = 9 Then
                Application.Workbooks.Open(Application.UserLibraryPath & "YourAddin.xla").RunAutoMacros (xlAutoOpen)
        On Error GoTo 0
    End Sub
    The YourAddin.xla is supposed to be in standard addin folder (%AppData%\Microsoft\AddIns)

  • Error in Bex Analyzer including the filter button command in Callback macro

    Hello,
    I have the following problem with the function filter button in the Bex Analyzer included in the callback macro:
    Because of using 2 hierarchies in the filter the setting drill down to level 2 in the query gives no right output in the Bex Analyzer. The drill down level 2 is not shown. SAP recommends the include of a filter button to solve this problem. With a filter button in the sheet the problem was solved.
    But after including the filter button command in the callback macro I get an error in MS Excel.
    The callback macro starts, the filter was set by the user and the data was refreshed. Because of the refreshing of the filter the callback function the callback function starts several times. After setting the filter the first time, the following macro avoids the several starting of the set filter function:
    Sub CallBack(ParamArray varname())
    On Error GoTo err_handler
       Dim lRange As Range
       Set lRange = varname(1)
    'Filter entfernend/delete filter
    Dim ZeichenFilter As Long
    ZeichenFilter = Len(Sheet4.Cells(41, 3).Value)
    Dim Filter1 As String, Filter2 As String
    Filter1 = Left(Sheet4.Cells(28, 3), ZeichenFilter)
    Filter2 = Left(Sheet4.Cells(41, 3).Value, ZeichenFilter)
    If Filter1 <> Filter2 And Filter2 <> "" Then
        onAction = True
        onAction = False
    End If
    'Filter setzen mit einmaligem durchlaufen/set filter and run one time
    If onAction = False Then
        onAction = True
        Call Sheet4.BUTTON_55_Click
        onAction = False
    End If
    exit_handler:
        Exit Sub
    err_handler:
        MsgBox Err.Description, vbOKOnly, "Error in " & " setMusterSub"
        Resume exit_handler
    End Sub
    After the filter was set the callback macro starts the second time. Then the Bex Analyzer erros with the sandglass. The working on VBA is possible, but not the working with Bex Analyer . Values in Excel weren’t shown.
    How can I avoid this error?

    Once I am adding VAR_VALUE_1 to the static parameters, the system generates two messages error:
    Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION
    System error in program SAPLRRS2 and form GET_SID-1
    Best Regards,
    Hanit

  • Macro not working in BEx Analyzer

    Can you please explain why my Macro is not working?
    We're on BI 7 with Excel 2007. I have done the following:
    1) Open Workbook from BEx Analyzer and the result display on the worksheet. The was inserted in C10 and therefore, the result was display from C10 onwards.
    2) I have created a Macro with the following code:
    Sub Macro1()
    ' Macro1 Macro
        Range("C5").Select
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .Color = 65535
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
    End Sub
    3) When click to run the Macro manually, I can see the color of C5 is changed.
    4) Now I have include this Marcro in Workbook Setting ->Exits tab, Run Macro on Refresh. Here I enter my Marco name.
    5) In Workbook Setting ->General tab, I also set the Refresh Workbook on Open option.
    6) I have also set the Trust Center setting: select Trust access to the VBA project and Enable all macros.
    7) Then I save the Workbook.
    8) when I re-open the Workbook, the color of C5 is not change!!!
    Can you please help.

    Aglukas,
    Thanks again. I understand the name of the Macro can be anything and this is how to create the Macro:
    1) Run workbook, the query result display on the screen.
    2) In Excel 2007, I click on Developer tab ->Macro.
    3) Enter Macro name (Macro1) and click on Create button.
    4) I have VB editor open with following:
    Sub Macro1()
    End Sub
    5) So added the following code to Macro routine in VBA Module:
    Sub Macro1()
    With ThisWorkbook.Sheets("Sheet1")
    Stop
    .Activate
    .Cells(15, 1).Interior.Color = RGB(220, 254, 250)
    End With
    End Sub
    6) I then added the Macro1 to Workbook Setting ->Exit tab, and click on Add Macro button.
    When I run/refresh the workbook, I didn't get into debug mode at all!!!
    What is wrong in above steps?
    Please advice, thanks.

  • Bex Analyzer 7.0 - BexEventHandler in Netweaver 2004s

    Hi, I noticed that in Bex Analyzer 7.0, there is a new class called BexEventHandler which gets hit each time I select a cell or a worksheet within my VBA code.  This did not happen in Analyzer 3.5.  And because of this, I am experiencing major performance issue in my macro.
    I have a workbook that contains 10 queries (10 worksheets) and a VBA code that merges all the data from the queries into 1 single worksheet.  Upon conversion to 7.0, my code is now running extremely slow as it is always going to the BExEventHandler class at each cell.select or sheet.select.
    Does anyone know how to bypass this BexEventhandler in Bex Analyser 7.0??
    Would appreciate any feedback you can provide.
    Thanks,
    Sheila

    Hi, I found the command in VBA that does disables the Bex event handler code.
    Application.EnableEvents = False
    Set this to false before your code starts and set it to true again after your code.

  • BEx Analyzer - dynamic  charts

    Environment: BW 3.5
    Hi all together,
    I have a query with the following presentation hierarchy: top level are the continents and second level are the countries belonging to the specific continents.
    Now I want to display the results in a chart as follows:
    If the countries are hidden and only the continents are visible, then the results of the continents should be displayed in the chart. If I show the countries to one continent then I´d like to see in the chart only the values for the countries of this specific continent.
    Is this possible with standard tool in BW or do I have to use VBA coding in Excel?
    Thanks for help.
    Greetings Anja

    It is possible to do the charts in the BEX Analyzer.  For this you should have BI 7.0 with SP 13 and the configuration of BEX Analyzer to BI system.
    If u give me u r mail id i will send some documents.
    Assign points
    Thanks and regards,
    Syed
    Message was edited by:
            Shahid Syed

  • Subtotals in BEx Analyzer

    Hey!
    How can I create subtotals in BEx Analyzer?
    Thanks a lot,
    Sabine

    So you want a subtotal row for every 10 customers and there is no additional information to determine these customers (for example the 10 customers are all customers with a specific postal code)?
    Which is your BW version? AFAIK you will have to go for Excel VBA macros if you are on NetWeaver2004 or below, in NetWeaver2004s it should work with Excel formula. I dont think there is an option to fulfill your requirement in Query Designer...
    Best regards,
    Björn

  • Run RFC FM from BEx Analyzer

    Hello everybody!
    I have to implement call of function module via RFC from BEx Analyzer.
    I created a VBA macros:
    Set BI_connect = Run("BExAnalyzer.xla!sapBEXgetConnection")
    If BI_connect.IsConnected <> 1 Then
       If BI_connect.Logon(0, False) <> True Then
          MsgBox "Logon failed"
          Exit Sub
       End If
    End If
    It works but it shows logon window twice: first when user open a workbook and second when run this macros. I want the second authorization to be silent.
    But if I set BI_connect.Logon(0, True) then Logon function returns 4 (missing parameter).
    How this problem can be solved?

    Hi,
    normally the function "BExAnalyzer.xla!sapBEXgetConnection" should deliver the existing SAP Connection (as of SAP). You should use the "BI_connect.Logon" only if there is no connection to the SAP Server yet. Are you getting (BI_connect.IsConnected = False)?
    If you want to use "BI_connect.Logon(0, True)" it should be possible in this way:
    Set myConnection = 'Run("BExAnalyzer.xla!sapBEXgetConnection")
    With myConnection
    .client = "600"
    .User = "USERNAME"
    .Password = "PASSWORD"
    .Language = "en"
    .systemnumber = "00"
    .System = "BWDCLNT600"
    .systemid = "BWD"
    .ApplicationServer = "156.158.7.161"
    .SAProuter = ""
    .Logon 0, true
          If .IsConnected = 0 Then
                 .Logon 0, False
    If .IsConnected <> 1 Then
    MsgBox "Automatic logon failed. Please enter your username and password in the next screen ..."
    Exit Function
    End If
    End If
    End With
    You will get another connection in this case, disadvantage is, that you should define the whole connection params in your vba code ...:(
    Regards,
    Kirill

  • Prevent BeX Analyzer from stealing focus while executing several queries

    Hi all,
    we have a vba program that runs several 3.5 queries in Excel (SAPBEXrefresh)
    Does anyone knows a solution to prevent BeX Analyzer from stealing the focus each time a new query starts or completes.

    I too am trying to find solution to this very same problem.
    I created a Excel VBA program to batch process BEx reports, which works great, but the users are finding that they can't work on anything else while the process runs, as BEx always returns the focus to the Excel window as each BEx report run is completed!
    In our googling, we ran across the following thread, which I've found so far to have the most detailed discussion of this problem:
    http://sap.ittoolbox.com/groups/technical-functional/sap-bw/sapbex-takes-focus-1188178?cv=expanded
    Unfortunately, no final resolution was provided there, and the thread is over 2 years old, and it looks like the poster who was closing in on the solution hasn't logged in to that particular forum in 2 years as well.
    But why don't you take a look at the link anyway, as it may give you some ideas. I will also continue to use that poster's ideas to try to work out a solution, and if I come across one, I will certainly share it with you.

  • Which macros does BEx Analyzer use? How to call the refresh macro?

    Hi everybody,
    I would like to get an overview about which macros the BEx Analyzer uses, espacially the macro which is responsible for refreshing the workbook. I want to know what BEX Analyzer is doing when I open the variable screen, I assume there is an SAP macro that opens the variable screen?? I tried to look in the online help at help.sap.com but couldn't find a list of macros.
    The idea behind this is, that I have a BEx workbook with 5 queries in it. A colleague now wnats to write a VBA code that calls the variable screen, enters  company 1, period and year, runs the workbook and saves it. Then opens the variable screen again, enters company 2, period year, etc etc etc......
    What my colleague needs to know is which macro he has to call for the workbook refresh / variable screen in order to make his VBA coding.
    Many thanks in advance!!
    Michael

    Which version of Bex are you using ? Bex 3.5 or Bex 7 ? This will significantly affect the answer.
    For Bex 3.5, here is some useful information;
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a55f9e09411d2acb90000e829fbfe/frameset.htm
    Edited by: Charlie Belt on Jun 7, 2011 9:12 AM

  • Poor performance when refreshing BEx Analyzer workbook

    We have a BEx Analyzer workbook that consists of about 10 worksheets, each displaying data from a different query. Refreshing the workbook in BEx Analyzer takes a very long time, typically 20 minutes or so. During this refresh process there is very little activity on the BW system itself. Each individual query runs on the web in a few seconds. Aggregates have been built for every query in the workbook.
    The workbook's file size has also increased from ~2MB  to 15MB as changes are made to the workbook.
    Any suggestions on how to improve workbook performance would be helpful.
    Thanks,
    Jason Kraft

    Hi Jason,
    On the file size, I recommend a VBA macro which reformats the sheets for you, particularly getting rid of use of colour as much as possible.
    The portal performance and the BEx Analyzer performance may be dependent on different servers. It could be that the BEx Analyzer is using the local machines CPU power. Just monitor CPU usage during idle times, opening of BEx and then refresh of the query data to see the demand.
    The portal on the other hand could use an entirely different server which has more CPU power and capacity than the platform that Analyzer is being run on.
    Incidentally, 20 minutes wait for a workbook with 10 sheets isn't necessarily a huge waiting time if these queries are returning many rows.

  • Bex Analyzer Calculation of Results

    Hello,
    I have created a query using Bex Analyzer. In the query I am also <b>using a formula to calculate forecast accuracy.</b> When I execute the query the <b>formula works fine in the rows.</b>
    The <b>problem is the (yellow) overall result row</b>. Here the result is not correct because it is supposed to be calculated differently. In the query properties the settings for "Calculate result as.." are limited and do not serve my purpose.
    <b>Is there a way (workaround) to calculate the result in the overall result row differently, maybe using VBA (does anyone have sample code in this case) or is there any other option?</b>
    Thank you very much for your help.
    Christian

    Hi Heike,
    First of all thank you very much.
    When I use "leaf(xyz)yourformulaforsinglevalues + not leaf(xyz) yourforumulaforresultrows" what should I include in the brackets where you mention (xyz)?
    Does this "leaf-function" work for all drilldown levels, meaning I define the formula using the formula editor, execute the query and make a drilldown according to another characteristic and have the correct result for the single values and the result rows at that level of detail too.
    Thank you very much for your help again. I really appreciate that.
    Christian

  • Error when starting Bex analyzer

    Hi All!
    We have a world wide BW-SEM application. In one country they get the following error message when starting Bex analyzer:
    <install error> Missing ActiveX component: Business Explorer Global Services
    Does anyone have a hint on what to do?
    Thanks for your help!
    Best Regards
    Pontus

    hi
    try to check with SAPBEXC.xla
    and take a look oss note 585643
    may need to manual register .dll with regsvr32
    Do an Installation check of the BEx Analyzer as follows:
    In the bex analyzer menu, Business explorer -> Installation Check -> Once the excel sheet opens, press the start button to start the check. Check the entries in red to see any missing/old ocx, dlls.

Maybe you are looking for

  • Roll over images in a slide show

    I am trying to make a slide show of before and after images for a client. Rather than just have them all one after the other, I want all the after images to display as normal, and the before to display on hover for each slide. I can make this work in

  • Transferring photos...preferences error message

    I am using a Macbook and am not able to transfer photos...I have my folder set up on iphoto and I choose that folder in the itunes preferences....I click "OK" and it says its upating ipod (on itunes) but then comes up with error message "Preferences

  • Disable the adobe reader extension

    I am creating a form in Live cycle designer 8.2 - Previously I enabled the reader extensions in Acrobat 9.0 Pro. I now want to put a hyperlink to a particular page - (normally I would use the link option in Acrobat pro. This is greyed out because it

  • My iPad is disabled and it says to connect to iTunes with my Mac. Its not working. How can I get my iPad to work?

    My iPad is  disabled and it says to connect to ITunes with my Mac. It still is not working.

  • ABAP - Project Systems.

    Hi All, Has anybody come across a requirement in which you were suppose to compare the hierarchy of planned and operational proejcts ? Regards, Dipesh Jhala <b>*Points for useful answer</b>