VBA - Best way to refresh on open (not all queries)

I have an AO template with many queries. However, I only want a specific query to refresh on open. Using SAPExecuteCommand's refresh crashes Excel at times. Is there an ideal way to accomplish this?
Reason I'm even doing this is to "initialize" the prompt variables, which apparently requires first refreshing the query. I do not use the prompt dialog but instead use VBA to set the prompts. Before I can set the prompts, I have to force one of the queries to refresh. Kind of a catch 22 situation. Is there anyway to SAPExecuteCommand "initialize variables"? Refreshing the query on workbook open frequently crashes AO/Excel.
Thanks in advance...

Hi John,
You're using the right Analysis API call for refreshes, but the reason you're getting the errors, sometimes, is that the workbook open event doesn't guarantee that Analysis is completely loaded and/or aware of the workbook.
Have you tried adding a Workbook_SAP_Initialize routine to your workbook? If you add this to your workbook, you can trigger a refresh more reliably. Analysis calls the routine, if it is present, after the workbook is opened, or after Analysis is loaded, while the workbook is open.
You may find that calling your code from this callback routine means you don't have to refresh before initializing the prompts too....
Add this code to your workbook in the ThisWorkbook module.
     Public Sub Workbook_SAP_Initialize()
       MsgBox "Analysis just initialized " & ThisWorkbook.Name
     End Sub
You can find more info on Workbook_SAP_Initialize in the user guide....
Andrew

Similar Messages

  • Best way to refresh page after returning from task flow?

    Hello -
    (Using jdev 11g release 1)
    What is the best way to refresh data in a page after navigating to and returning from a task flow with an isolated data control scope where that data is changed and commited to the database?
    I have 2 bounded task flows: list-records-tf and edit-record-tf
    Both use page fragments
    list-records-tf has a list.jsff fragment and a task flow call to edit-record-tf
    The list.jsff page has a table of records that a user can click on and a button which, when pressed, will pass control to the edit-record-tf call. (There are also set property listeners on the button to set values in the request that are used as parameters to edit-record-tf.)
    The edit-record-tf always begins a new transaction and does not share data controls with the calling task flow. It consists of an application module call to set up the model according to the parameters passed in (edit record X or create new record Y or...etc.), a page fragment with a form to allow users to edit the record, and 2 different task flow returns for saving/cancelling the transaction.
    Back to the question - when I change a record in the edit page, the changes do not show up on the list page until I requery the data set. What is the best way to get the list page to refresh itself automatically upon return from the edit-record-tf?
    (If I ran the edit task flow in a popup dialog I could just use the return listener on the command component that launched the popup. But I don't want to run this in a dialog.)
    Thank you for reading my question.

    What if you have the bean which has refresh method as TF param? Call that method after you save the data. or use contextual event.

  • What is the best way to record a video(not big) for free on a mac w/isight?

    What is the best way to record a video(not big) for free on a mac w/isight? I need to just make a short (less than 5 minute, no special effects) video, but I can't figure out any programs that will make this possible for me.
    Thanks.

    Hi Carolyn,
    you can use iMovie to record a video for free on a Mac with iSight.
    1. Open iMovie HD
    2. Choose “Create a new project”
    3. Name the project for example “iSight Movie” (first field). In the second field, let the default location “Sequences”, in the third one, video format, choose “iSight”. Push “Create”
    4. iMovie window opens, next to the scissors, choose the camera (Camera mode), then iSight. Now you appear on the screen, right?
    5. Press “Record with iSight” in the main picture window.
    6. Press the same button to stop. Your new clip appears now in the clip panel at the right.
    7. You are done!
    iMac G5 PPC 2,1 Ghz   Mac OS X (10.4.8)  

  • Access-SQL Server (Client Server Configuration) Best Way To Refresh SQL Server Records ?

    We are using Access 2013 as the front end and SQL Server 2014 as the back end to a client server configuration.
    Access controls are bound to the SQL fields with the same names. When using Access to create a new record in a Form, the data are not transferred to SQL if the form is exited to display a different Form or Access is closed. If the right or left arrow navigation
    buttons at the bottom of the form are first used to display either the previous or next record, then the data in the new record are correctly transferred to SQL.
    What is the best way to refresh the new SQL record prior to the closing of the new record in the bound Access form ? We have tried Requery of the entire form and with all of the individual controls without success. We are looking for a method of refreshing
    SQL that functions in a manner similar to that of what happens with the navigation buttons.
    Thank you very much for your assistance.
    Robert Robinson
    RERThird

    Hi Stefan,
    I had added the code to set me.dirty = False in response to the On Dirty event and didn't realize that it was working properly. I had tried other several approaches and must have become confused somewhere along the line.
    I retested the program. On Dirty is working and the problem is solved.
    Thank you very much for your assistance.
    Robert Robinson
    RERThird

  • JPA -- Best way to refresh a List association?

    Hi,
    I need to refresh a OneToMany association.
    For example, I have two entities: Header & Detail.
    @Entity
    @Table(name="HEADERS")
    public class Header implements Serializable {
        @OneToMany(mappedBy="header")
        private List<Detail> details;
    @Entity
    @Table(name="DETAILS")
    public class Detail implements Serializable {
        @ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="HDR_ID", referencedColumnName="HDR_ID")
        private Header header;
    }So, I fetch the Header along with all its Details.
    At a later point of time, I know that some Detail rows in the database have been changed behind my back. I need to re-fetch the list of Details. What should I do?
    1. I could add a cascade parameter to the @OneToMany association. I could specify:
    @OneToMany(mappedBy="header", cascade={CascadeType.REFRESH})Then I could run:
    entityManager.refresh(header);The trouble is that, since all the Details are already in the cache, the cached entities will be returned, not the ones fetched from the database. So, I won't refresh a thing. A query will be sent to the database indeed, but I will get the cached (i.e. stale) entities. I don't know of a way to specify something like
    setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE)dynamically for associations, so that the values in the cache would be replaced with the ones fetched from the database.
    2. I could try to turn off the caching for the while Entity class. The trouble is that for some reason this doesn't work (see my other question here JPA -- How can I turn off the caching for an entity? Besides, even if it worked, I don't want to turn off the caching in general. I simply want to refresh the list sometimes.
    Could anyone tell me what's the best way to refresh the association?
    Best regards,
    Bisser

    Hi Chris,
    First, let me thank you that you take the time to answer my questions. I really appreciate that. I wish to apologize for my late reply but I wasn't around the PC for a while.
    TopLink doesn't refresh an entity based on a view. I will try to explain in more detail. I hope you'll have patience with me because this might be a bit longer even than my previous post. I will oversimplify my actual business case.
    Let's assume we have two tables and a view:
    create table MASTERS
      (id number(18) not null primary key,
       master_name varchar2(50));
    create table DETAILS
      (id number(18) not null primary key,
       master_id number(18) not null,   -- FK to MASTER.ID
       price number(7,2));
    create view DETAILS_VW as
      select id, master_id, price
      from details;Of course, in real life the view is useful and actually peforms complex aggregate calculations on the details. But at the moment I wish to keep things as simple as possible.
    So, I create Entities for the tables and the view. Here are the entities for MASTERS and DETAILS_VW, only the essential stuff (w/o getters, setters, sequence info, etc.):
    @Entity
    @Table(name="MASTERS")
    public class Master {
         @Id
         @Column(name="ID", nullable=false)
         private Long id;
         @Column(name="MASTER_NAME")
         private String masterName;
         @OneToMany(mappedBy="master", fetch=FetchType.LAZY, cascade=CascadeType.REFRESH)
         private List<DetailVw> detailsVw;
    @Entity
    @Table(name="DETAILS_VW")
    public class DetailVw {
         @Id
         @Column(name="ID")
         private Long id;
         @ManyToOne(fetch=FetchType.LAZY)
         @JoinColumn(name="MASTER_ID", referencedColumnName="ID")
         private Master master;
         @Column(name="PRICE")
         private Double price;
    }So, now we have the tables and the entities. Let's assume one master row and two detail rows exist:
    MASTER:  ID=1, MASTER_NAME='Master #1'
    DETAIL:  ID=1, MASTER_ID=1, PRICE=3
    DETAIL:  ID=2, MASTER_ID=1, PRICE=8And now let's run the following code:
    // List the initial state
    Master master = em.find(Master.class, 1L);
    List<DetailVw> detailsVw = master.getDetailsVw();
    for (DetailVw dv : detailsVw) {
         System.out.println(dv);
    // Modify a detail
    EntityTransaction tx = em.getTransaction();
    tx.begin();
    Detail d = em.find(Detail.class, 2L);
    d.setPrice(1);
    tx.commit();
    // Refresh
    System.out.println("----------------------------------------");
    em.refresh(master);
    // List the state AFTER the update
    detailsVw = master.getDetailsVw();
    for (DetailVw dv : detailsVw) {
         System.out.println(dv);
    }And here are some excerpts from the console (only the essentials):
    DetailVw: id=1, price=3
    DetailVw: id=2, price=8
    UPDATE DETAILS SET PRICE = ? WHERE (ID = ?)
         bind => [1, 2]
    SELECT ID, MASTER_NAME FROM MASTERS WHERE (ID = ?)
         bind => [1]
    SELECT ID, PRICE, MASTER_ID FROM DETAILS_VW WHERE (MASTER_ID = ?)
         bind => [1]
    DetailVw: id=1, price=3
    DetailVw: id=2, price=8You see, the UPDATE statement changes the DETAILS row. The price was 8, but was changed to 1. I checked the database. It was indeed changed to 1.
    Furthermore, due to the refresh operation, a query was run on the view. But as you can see from the console output, the results of the query were completely ignored. The price was 8, and continued to be 8 even after the refresh. I assume it was because of the cache. If I run an explicit query on DETAILS_VW with the hint:
    q.setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE);then I see the real updated values. But if I only refresh with em.refresh(master), then the DetailVw entities do not get refreshed, even though a query against the database is run. I have tested this both in JavaSE and in OC4J. The results are the same.
    An explicit refresh on a particular DetailVw entity works, though:
    DetailVw dvw = em.find(DetailVw.class, 2L);
    em.refresh(dvw);
    System.out.println(dvw);Then the console says:
    DetailVw: id=2, price=1So, the price is indeed 1, not 8.
    If you can explain that to me, I will be really thankful!
    Best regards,
    Bisser

  • What is the easiest and best way to install or open flash drive in Sarfari on my Macbook Pro...2010 model using mountain lion

    what is the easiest and best way to install or open flash drive in Sarfari on my 2010 macbook pro using mountain lion?

    There is no really good way to do what you want. Any tracks you purchase via your own iTunes Store account are for your personal use, tied to your iTunes Store account, and can't be given to anyone else. If you don't want to gift the tracks to her and can't access her iTunes Store account, the only option other than creating her a completely new iTunes Store account (which will require a new email address for her) is to buy the CDs those tracks are on.
    Regards.

  • What is the best way to make drawings an notes during class (on my iPad), which I can add to my (digital) handout later on?!

    What is the best way to make drawings an notes during class (on my iPad), which I can add to my (digital) handout later on?!

    Hello BDAqua, thanx for the suggestions. Before I saw this reply I tried to first quit the finder and then to relaunch the Finder but that resulted was a blank gray screen.
    In the end I ended up having to power down the iMac.
    Fortunately the RAID array that was "active" seems to be fine and also has a firewire 800 connection so I can use it_ just not with thunderbolt until this issue is solved.
    I'm going to check in the Applications>Utilities>system log to see if any clues are evident_ thank you for the suggestion.
    PS: Nothing of note was obvious as a root cause in the Activity Monitor though.
    hmmm....I was told that the Helios and seritek card were compatable and that the Helios didn't require any drivers..it will be a drag if there isn't an easy fix for this since this new PCIe card from seritek is the first to offer port multiplier compatibility for eSATA to thunderbolt...since they are both new I'm hoping that an OS upgrade will be the fix (presently7.2)...we shall see.

  • I just want to save mail that i open, not all junk mail- how do i do this

    I use an AOL account on Mail
    How do i set up a rule:
    where I just want to save mail that i open - not all mail- how do i do this. I cant find a rule that would do this.
    I dont want to have to manually copy each email that i open to my hard drive.
    Any suggestions?
    Thanks

    Hi Ross!
    Try this:
    Open Mail preferences > Accounts > Advanced.
    Below "Keep copies of messages for offline viewing:" select Only messages I've read.
    ali b

  • What's the best way to erase content but not the applications?

    I'm giving away my iMac to my niece. I want to erase all my  content files, libraries ,etc., but not the applications. What's the best way to do this, and to do it securely?

    If you have Downloaded and Upgraded to Lion See...
    Here is an excerpt of the SLA; the Lion license (purchased from MAS) is NOT transferable. The SLA is quite clear:
    B. If you obtained your license to the Apple Software from the Mac App Store or on Apple-branded physical media, it is not transferable. If you sell your Apple-branded hardware to athird party, you must remove the Apple Software from the Apple-branded hardware beforedoing so, and you may restore your system to the version of the Apple operating systemsoftware that originally came with your Apple hardware (the “Original Apple OS”) andpermanently transfer the Original Apple OS together with your Apple hardware, provided that:(i) the transfer must include all of the Original Apple OS, including all its component parts,printed materials and its license; (ii) you do not retain any copies of the Original Apple OS, fullor partial, including copies stored on a computer or other storage device; and (iii) the partyreceiving the Original Apple OS reads and agrees to accept the terms and conditions of theOriginal Apple OS license.
    Now Proceed...
    Boot from the original OS installer disk and do an Erase & Install.
    When the Mac reboots into Mac Setup Assistant Quit and shut it down.
    When the New Owner Boots it up it's a brand new Mac... just like when you got it.
    ( The Original Install Disc(s) should also be included with the sale )
    http://www.ehow.com/how_5852122_restore-imac-factory-settings.html

  • What is the best way to make skin uniform (not necessarily blurring it!)

    Hi,
    I have some photographs where the skin of the model's leg is not of uniform brighteness. Without blurring it, I have tried the clone stamp but it is very difficult to not introduce further variations in brightness.
    What is the best way to make skin uniform in brightness (actually, the same color!)?
    Thanks,
    Juan Dent

    I know EXACTLY what you mean.  I was doing something exactly on those lines just yesterday.
    It's not trivial, but it's doable.
    For hard "spots", you can try the Spot Healing Brush first.
    But here's a neat trick I sometimes use that can nicely increase the overall smoothness:
    1.  Select just the skin area.
    2.  Contract the selection a bit and feather the edge, just to make sure you don't mess up the edges.
    3.  Filter - Noise - Median, and adjust the radius to be fairly large.  Watch the image to see the smoothness level.
    4.  Edit - Fade and knock back the effect, so that it's not perfect, but makes a subtle improvement.
    Then, for gentle darkening lightening, try the Burn and Dodge Tools, set to a low Exposure level (and possibly with Airbrush Mode on).  Work gently.
    Cloning with low opacity can sometime help as well.
    -Noel

  • What is the best way to install client sccm 2012for all computer in my company

    in my company(25000 users) we have alot of branch(100-150 small Branch (every branch 50-100 users)) & 20 branch (100-100 users) .
    now only 11000 client in sccm2012
    What is the best way to install client for all computer
    Note that sccm 2012(1 primary site and 4 site system server every server (4 roles (management point  , Distribution Point  , site system , component server  ) ))
    and in boundaries i create boundaries but not for all branch and enable (boundary group for site assignment ) for every group 
    What is the best way to install client for all computer 
    thank u 

    You basically have 3 options, if you disregard a manual install.
    1. Client Push. Configure an account with local admin rights on the clients, and enable Site-Wide pushing of client.
    2. GPO. Import the GPO templates and enable the client to be installed that way
    3. Startup script.
    Of the 3, I usually go with a combination of client push and GPO.
    Take a look at http://technet.microsoft.com/en-us/library/gg712298.aspx for the complete documentation.
    FB

  • Best way to create a seperate Play All option...

    On my sub-menus I have an option to Play All of the video titles for that sub-menu. What is the best way to do this? I was planning on creating one time line with the corresponding video clips for each sub-menu. If I do it like this will I have double the amount of data using space on my DVD?
    I haven't had the chance to experiment myself... I am waiting on footage to render as I type.
    Thanks,
    Robert

    Robert.
    Are these titles all joined together, or separate clips?
    If the former, then point the "Play All" to the first chapter, and then create a series of Chapter Playlists, one for each clip, and point the submenu buttons to these. The end actions should go to the submenu they were called from.
    If the latter, then set up a series of ordinary playlists.
    For "Play All", create a playlist with every clip in the correct sequence.
    For the individual clips, simply point the buttons to the individual timelines, and have their end actions reverting to the submenu they were called from.
    Hope this helps.

  • Create many pages is too slow, is there a way to format each page, not all?

    i'm creating hundreds of pages of report (very complicated report)
    when i using cliend/server version of oracle report, it created only the page
    user is viewing, and rest is not yet formatted.
    so even it has thousands of pages, since not all the pages were formatted,
    performance was not an issue,
    but now, using 10G, report is created using browser as html page instead
    of oracle's own cliend/server thing,
    if the report has thousands of pages, it is very slow since whole report is
    created and it has to wait till every page is formatted before displaying the
    first page.
    pagestream just changed the way it's displayed but still it formatted all the
    pages before displaying first page
    is there any way to format pages only when it's being viewed?
    or any other way to boost the performance?
    now it's pretty much unacceptably slow
    thanks

    i'm creating hundreds of pages of report (very complicated report)
    when i using cliend/server version of oracle report, it created only the page
    user is viewing, and rest is not yet formatted.
    so even it has thousands of pages, since not all the pages were formatted,
    performance was not an issue,
    but now, using 10G, report is created using browser as html page instead
    of oracle's own cliend/server thing,
    if the report has thousands of pages, it is very slow since whole report is
    created and it has to wait till every page is formatted before displaying the
    first page.
    pagestream just changed the way it's displayed but still it formatted all the
    pages before displaying first page
    is there any way to format pages only when it's being viewed?
    or any other way to boost the performance?
    now it's pretty much unacceptably slow
    thanks

  • Best way to programmatically test opening a pdf

    My company, among other things, uses an image processing library to do complex conversions of various types of content ... including pdfs. Sometimes, this library fails and we are looking for a way to, offline, automate the process of checking whether the pdf file was actually valid. All we really want to do is have one machine which can be triggered at some point after an error occurs to try opening the file and mark a record in our error db indicating if it could be opened or not. Then we can act accordingly.
    I found pdf library but that has a lot more functionality than simply open. Also, the form to get information on this library does not work for me so I am unable to contact any sales reps from adobe. What would someone recommend for this situation and if it is pdf library, can someone tell me how to get the online submission system to work. I tried chrome and safari and neither work (I can't enter the state field in either and the submit via email button does nothing).
    Thanks
    Lee
    PS: If this is not the correct discussion alias, please let me know where to post. There didn't seem to be a dev sdk related disucssion

    In terms of learning more about the "Adobe PDF Library", how to use it and how to license it, you should get in touch with someone at Datalogics (as far as I know Adobe only handles big key account customers themselves when it comes to the Adobe PDF Library).
    Datalogics have a website at http://www.datalogics.com/ and their contact form at http://www.datalogics.com/company/contactus.asp should work just fine. If not, I'd try [email protected] ...
    Olaf

  • BEST WAY TO REFRESH A MATERIALIZED VIEW

    Hi, I have a Materialized View that was created after two Base Tables, Table A is a Dynamic Table, this means that it have Insert's, update's and delete's, and a Table B that is a Fixed Table, this means that this table do not change over time (it's a Date's Table). The size of the Table related to the Materialized View is to big (120 millions rows) so the refresh has to be very efficient in order to not affect the Data Base performance.
    I was thinking on a Fast Refresh mode but It would not work because the log created on the B table is not usefull, the thing is that I created the two materialized view log's (Tables A and B) and when I execute the dbms_mview.refresh(list =>'MV', method => 'F')+ sentence I got the error
    cannot use rowid column from materialized view log on "Table B" ... remember that this table don't change over time ...
    I need to mantain the Materialized view up to date, but do not know how ... Please Help !!!!!

    The Materialized View name is test_sitedate2
    The Table B name is GCO01.FV_DATES .... is a Fixed Table ... do not change over time ...
    The Code of the MV is
    CREATE MATERIALIZED VIEW TEST_SITEDATE2
    REFRESH FORCE ON DEMAND
    AS
    SELECT site_id, date_stamp
    FROM gco01.fv_site, gco01.fv_dates
    where fv_dates.date_stamp >= fv_site.start_date
    and fv_dates.date_stamp >= to_date('01/03/2010', 'dd/mm/yyyy')
    and fv_dates.date_stamp < to_date('01/04/2010', 'dd/mm/yyyy');
    Each table gco01.fv_site and gco01.fv_dates have it's materiallized view log created
    The error is ....
    SQL> execute dbms_mview.refresh(list =>'test_sitedate2', method => 'F');
    begin dbms_mview.refresh(list =>'test_sitedate2', method => 'F'); end;
    ORA-12032: cannot use rowid column from materialized view log on "GCO01"."FV_DATES"
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2254
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2460
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2429
    ORA-06512: at line 1
    Thank's

Maybe you are looking for