VB Macro not executing on refresh

Hi,
I have followed the following steps but it is not working can you please advice:
1.     Under VB Editor  this workbook  I added the following code:
Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
Dim c As Range
For Each c In resultArea.Cells
If c.Value = "#" Then c.Value = "-"
Next c
End Sub
2.     Quit the VB Editor, and save the query as a new workbook.
On refreshing the workbook still the # sign appears in the result. If I go and check as in step 1 the routine still exist. How do I fix this issue?
Thank you,
sam

siv,
in the view code i typed exactly as you gave,
Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
Dim ws As Worksheet
Set ws = resultArea.Parent
'Remove '#'
Selection.Cells.Replace What:="#", Replacement:="", LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=True
resultArea(1, 1).Select
End Sub
still it is displyaing # in the result. please advice

Similar Messages

  • Macro not executed in the background

    Hi all,
    I have created a macro to delete the forecast and it is working fine in the foreground, whenever i'm running it in the background, it is not getting executed, no forecast is getting deleted. In the job logs, it is giving the following message:
    "No data has been changed; data must not be save".
    I have tried with different logics for the macro, all are working fine in the foreground, coming to backgroung, nothing is working.
    Please help me out.
    Thank you
    Regards,
    Raj

    Hello Raj,
    For executing in background, you need to set up the 'DP Background' jobs. You must ensure that you define a proper Selection ID in Interactive Planning and assign this selection ID to the DP background job. If the proper selection data is not picked up by the Macro, then it may not execute. Hope you have followed that process of setting up Background DP jobs correctly.
    Also note that when you execute the Macro in background, if data has not been changed, you generally get a message saying 'data not saved'.

  • Macro not executing on opening a workbook in 2004s analyser

    Hello Everyone,
    I have a macro called callback in my workbook and in the workbook setting under the exits tabs I have checked "Run macro on refresh " option with callback as the macro.
    The macro is not being executed automatically on opening the workbook even though the workbook is being refreshed on opening the workbook. Again If i were to refresh the query after opening the workbook it gets invoked.
    A couple of people seem to have same issue but no one has a clear cut solution.
    Please be advised that I am using 7.0 and I am SPS15 with FEP 6 and patch 1.

    Hi Mitchell,
    This is actual code  I have used :
    Sub Macrotest(ParamArray varname())
    ' Macro1 Macro
        Range("H2").Select
        Selection.Interior.ColorIndex = 15
        Range("K2").Select
        Selection.Interior.ColorIndex = 4
    End Sub
    The problem I have is that the macro is not invoked the very first time I open a workbook (I have the query refresh on wokrbook option set). Once the workbook is open changing the report or variables trigger the macro.
    Anyways I have sent an error message to SAP, will update this thread on feedback from them.

  • SSIS Script task not executing macro through SQL Agent (but it does through bids)

    <p>Hello everyone,</p><p>I am having an issue with SQL Agent when executing a macro contained in a script task component. The script task actually opens an excel file, runs the macro, save and closes the file. </p><p>When
    I execute the package via BIDS/Visual studio, it works like a charm. However, when i execute the package with SQL agent, the package runs successfully but it seems that the macro is not executed as the excel file has not been modified as it should have. Also,
    the history log does not show any error messages. </p><p>Could </p>

    Thanks!I did create a credential and a proxy too but still the macro is not executed.I have searched online for solutions but no one has experimented this kind of issue before it seems. Please have a look at the script task code:
    Imports
    Excel = Microsoft.Office.Interop.Excel
    Imports
    System
    Imports
    System.Data
    Imports
    System.Math
    Imports
    Microsoft.SqlServer.Dts.Runtime
    <System.AddIn.AddIn(
    "ScriptMain", Version:="1.0",
    Publisher:="", Description:="")>
    <System.CLSCompliantAttribute(
    False)> _
    Partial
    Public
    Class ScriptMain
    Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    Enum ScriptResults
    Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
    Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    End
    Enum
    Public
    Sub Main()
    Dim Macro_name
    As
    String
    Dim ExcelObject
    As
    New Microsoft.Office.Interop.Excel.Application
    Dim oBook
    As Microsoft.Office.Interop.Excel.Workbook
    Dim oBooks
    As Microsoft.Office.Interop.Excel.Workbooks
    Try
    Macro_name =
    "Macro001"
    ExcelObject =
    CType(CreateObject("Excel.Application"),
    Excel.Application)
    ExcelObject.Visible =
    True
    ExcelObject.UserControl =
    False
    ExcelObject.DisplayAlerts =
    False
    oBooks = ExcelObject.Workbooks
    oBook =
    CType(oBooks.Open("C\Book1.xls"),
    Excel.WorkbookClass)
    ExcelObject.Run(Macro_name)
    Catch ex
    As Exception
    ExcelObject.Application.Quit()
    ExcelObject.DisplayAlerts =
    True
    ExcelObject =
    Nothing
    End
    Try
    Dts.TaskResult = ScriptResults.Success
    End
    Sub
    End
    Class

  • Oracle ADF refresh as deferred does not execute query on page load

    In the oracle ADF page I have two panel boxes. (Oracle ADF 11.1.1.4)
    a) Personal information panel box with PanelFormLayout (PersonalInfoViewObj) - ReadOnly View Object
    b) Address information panel box with Table (AddressInfoViewObj) - Read Only View Object
    For the iterators in a) and b) I have kept refresh condition as deferred and cacheResult=false. Also in b) for af:table, I have kept contentDelivery="immediate"
    When page loads it fires SQL query for a) and populate the data in Personal information panel box. However for b) it does not execute the SQL query and the data is not getting populated ( in AddressInformation panel with the tables. Please note data is there in the DATABASE......)
    Becasue with the refresh as deferred it was not executing the sql query for Panel b) (panel with Table and table iterator). I have tried refresh as always and refresh ifNeeded/renderModel/prepareModel however in that case it is executing the SQL query two times (twice).
    Please let me know the best way to fix this issue.

    Hi,
    I think you need a method in an application module to init your data.
    In your AM : create a method like :
    public void init(){
    getViewObject().executeQuery();
    }In your adfc-config.xml create a methodCall from this method and a "control flow case" from the methodCall to your page.
    and keep refresh as "deferred " in your pageDef.
    Clément

  • Interactive report jquery not executed on pagination

    recently i fell into another problem when using jquery in an interactive report.
    in the page header i do this
    <script type="text/javascript">
    $(document).ready( function() {
       var pageID = $('#pFlowId').val();
       $('.Artikelinfo').each( function(i) {
                var $item = $(this);
                var get = new htmldb_Get(null,pageID ,'APPLICATION_PROCESS=GET_ARTIKEL_INFO',0);
                get.addParam('x01', $item.attr('artnr'));
                $item.attr('rel', get.url());
                $item.attr('relTitle', $item.html());
                return true;
       $('.Artikelinfo').cluetip({
             arrows: true,
             tracking: true,
             titleAttribute: 'relTitle'
    });in the link attributes of a column i put this:
    target="_blank" class="Artikelinfo" artnr="#NUMMER#" rel="" reltitle=""it works like charm... but only on the first page.
    as soon as a change page the jquery is not executed, the attributes are not set.
    i think this is because while pagination of the IR the actual page is not reloaded.
    how can i achieve that that the jqury part is executed after pagination?
    u can find an example here [http://apex.oracle.com/pls/otn/f?p=19645:1] username "user1" password "abc123"
    hover over the first column u will see a cluetip.
    afer the first pagination, the hoverhelp is lost
    thanks
    peter

    below is from http://api.jquery.com/ajaxComplete/
    "Register a handler to be called when Ajax requests complete. This is an Ajax Event."
    "Whenever an Ajax request completes, jQuery triggers the ajaxComplete event. Any and all handlers that have been registered with the .ajaxComplete() method are executed at this time."
    I'm looking into this now...
    Also need to know how to AJAX refresh the IR report to get the changes I did through an AJAX call... ??????
    Anyone???

  • Materialized view does not exist upon refresh

    Hi all,
    I got the following stack trace upon executing 'DBMS_MVIEW.REFRESH('Layout_tab','C')' to refresh an materialized view upon an object table:
    ORA-23401: materialized view "MINIMOL"."LAYOUT_TAB" does not exist
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 794
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 851
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 832
    The view create statement is following:
    CREATE MATERIALIZED VIEW PlateLayout_tab
    OF PlateLayout
    CACHE
    REFRESH ON DEMAND
    AS
    SELECT
    PlateLayout(l.id,VALUE(pos),l.ComputeCheckerboardPosition(VALUE(pos)))
    FROM
    Layout_tab l
    , TABLE(mcu_enumerate.LoopFor(1,l.wells_across * l.wells_down)) pos;
    now what is going wrong? I can't even create the view with the 'REFRESH ON COMMIT' option.
    Thanks,
    Henrik

    John,
    it is only a typo in the posted message, but the executed SQL-smt of course was:
    EXECUTE DBMS_MVIEW.REFRESH('PlateLayout_tab','C');
    After browsing through metalink I even tried this:
    EXECUTE DBMS_MVIEW.REFRES('PlateLayout_tab','C','',TRUE,FALSE,0,0,0,TRUE);
    with the same stack trace.
    By the way the MVIEW is accessible via:
    SELECT * FROM PlateLayout_tab
    Thanks,
    Henrik

  • Oracle Error - statement handle not executed state

    Hello,
    A BCA scheduled job has failed and returned with the following error. Does anyone have an idea to fix this error.
    Connection or SQL sentence error: (DA0005): [Exception: DBD, ORA-24338: statement handle not executed State: N/A] The following data providers have not been successfully refreshed
    Thanks
    -Gopi

    Please provide more information on what Crystal Reports or Business Objects product you are using. The more details you can provide, the quicker the resolution...
    Ludek

  • Business Rules Do Not Execute When Saving a Form

    When saving a form the attached business rules are not executing. Sometimes we are unable to validate business rules via AAS. When this happens we do a security refresh from Planning to Essbase and Essbase to Shared Services. At other times, we bounce planning and even Essbase and this seems to fix the problem. Today we have tried every combination (bounce planning, Essbase, AAS) and we are able to at least validate biz rules in AAS but we (i.e., users) are uanble to execute the biz rule when they save via the planning form. There are no issues running the biz rules when saving the form using an administration account. Can someone explain what's going on or provide direction as to why this problem happens and how to fix this issue?

    Hi,
    Well is your version 9.3.0.1? If yes then you have my sympathies :). We too have this version and face similar problems with Business Rules. Usually things come back to normal after following the steps mentioned above. However what I would want to know is the following:
    1) From where are you running the Business rules? I am asking this because if you are trying to run from Smartview then I would suggest you look at the time it takes for the Business Rules to execute. If it excedes the timeout settings then it will exit out. However the BR might still be running in the back ground. This you can confirm by looking at the data.
    2) Have you checked if you have installed all the patches?
    Hope it helps.
    Regards,
    Amol

  • Inconsistent behavior of Macro when executed at Different Levels.

    Hi Gurus,
    I have a Default macro in my Data View. I tried to suffle between the levels of data and the macro gives different results when i perform same operations in different sequence.
    Right now I have this Default Macro defined to run at "All Planning Objects" level in the Macro Workbench (/SAPAPO/ADVM)
    I have 2 CVCs in my selection.
    1. I loaded both the products in planning grid and looked at the Total Level.....the result of macro is 5.......then I go to the Details All of the Product and the the result is still 5.
    2. Now, i do a different sequence.....i first see the data for Detaills All......the Result is 10.....and then I go to Totals Level and result becomes 5.
    So, the Macro is not executing Consistently.
    Any idea how can I solve this issue.....??
    Do I need to run the macro at u201CDetails Onlyu201D level to solve this issue ?
    OR
    Do I need to use the Drill Up and Drill Down Functionality ?
    thanks & regards
    ~Abhishek

    For quick assistance post testable script.
    Tree processing examples using recursive CTE:
    http://www.sqlusa.com/bestpractices2005/organizationalchart/
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Execute without refresh

    can i execute a query without refresh?
    I try
    create database sample1
    and execute it but sample1 does not appear without refreshing the databases?

    No, SSMS Object Explorer don't refresh automatically, you have to refresh manually.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • BPM send step not executed in BPM (after Message split)

    Hello everybody,
    we use BPM:
    We have a paralell Block which should send the rows of a multiline element. In SXMB_BPE_MONI the send step is not executed?
    Any idea?
    Thanks  lot, regards Mario

    HI,
    Go to SXMB_MONI_BPE->and check the workflow log (technical details).and go to SXI_CACHE and check the return code of the Integration Process. It should be zero. If not try to activate the same
    If there is no error then go with like this-
    Also check the Syntax in Integration Repository with F7. Change the IP and activate it. If there is no syntax errors.
    Then reimport the IP into Directory and then test your scenario
    Regards,
    Moorthy

  • MS Office Report (Report Generation toolkit) is not executable​, Xnode broken?

    Hi, I am trying to generate an excel report, and I figured it would be easier to use the MS Office report VI, but I am getting the broken arrow saying the SubVI is not executable and that the library that defines the xnode is broken... here is a screensot attached, I already uninstall and reinstall the report generation toolkit and still the same... this is what I found on NI: "This error occurs when the library that defines the XNode you used is broken. To correct this error, reconfigure the XNode." but no idea how to reconfigure xnode
    Attachments:
    Error.png ‏67 KB

    What version of LabVIEW are you using?
    What is the nature of your Report?  What should it look like?  What kind of data should it contain?
    Can you show us some code that you've tried to use?  If so, include the code as either a Snippet or as a VI attachment (so we can plug it into our own LabVIEW installations and experiment with it).
    I generally find that the Report Generation Toolkit is a very easy way to generate Excel Workbooks.  I work primarily with LabVIEW 2012 and LabVIEW 2014.
    Bob Schor

  • I recieve the following error when running an executable ("This VI is not Executable. The full development version of Labview is required to fix the errors"

    I recieve the following error when trying to build and run a labview executable. I am able to build the executable but when trying to run the executable, a pop up window comes up asking the user to select a dll. (please see screen shot attached). Once the DLL is selected, I get the error that This VI is not Executable. The full development version of Labview is required to fix the errors. (please see screen shot attached). I have also attached a snapshot of the project window.
    I have the professional development system
    I can run the main VI
    all the required DLL's are in the dependencies section of the project window.
    I am trying to find the root cause of this error but to no avail. can anyone give me a clue to what i am missing here. Any suggestions on where i should look to find the problem ?
    Thanks in advance to all labview users for your help
    Attachments:
    project window.PNG ‏36 KB

    other PNG
    Attachments:
    Broken Arrow on EXE.PNG ‏179 KB

  • I get a "vi is not executable" error when building an application.

    I have an ongoing project that has worked fine in the past when building an application. I have recently added some report generation toolkit vis(Excel) and get an error for some of the ni vis and some of my own that call lower level excel vis. The error is that he vi is not executable, however they run fine in the development environment. I do not get this error if I save all vi's into one llb with save with options command and then build. However, when I try to run the app, this error re-appears. Also, do I have to add the dynamically loaded vi's that are part of the toolkit in my build script? Could this be the cause of the problem? If so, what's the best way to find all of them? Any suggestions?

    You have hit in on the nail! You do need to add the dynamically loaded VIs when you are creating an executable from your VI. You need to add _wordsub.lib and _exclsub.lib as dynamically loaded VIs into your executable. Try this and let us know if you have any more problems with it.
    J.R. Allen

Maybe you are looking for

  • Flash Cookies are turned off - ho to turn them on?

    Hello! I have Adobe Flash Player 16.0.0.296 installed on Windows 7 A web-site I use complains about flash cookies turned off. Where is in Settings Manager controls to turn cookies on? Thank you!

  • COPA calculated key figures and scheme on R/3 side

    We have created calculated key figures on the R/3 side and inputted formula (which is essentially the scheme/basic formula in transaction KER1) for this key figure.  We then checked off this key figure in the COPA datasource.  These key figures are o

  • Help involving the iTunes Security Questions

    i noticed in my search for an answer that many iTunes users were having the problem of not knowing their security questions. i had this same problem, and tried for hours to reset my questions without any luck. i finally called an Apple support line,

  • Samsung Reality Turns Off All the Time!

    I've had the samsung reality for a while now. Occasionally, it would randomly turn off & turn back on. Recently it started doing it allllll the time. When I tried to send or save messages it will just turn off. How can I fix this?!?!

  • Phone is jammed

    When I was updating my OS to 3.0 there was a problem and the update got cancelled. My phone got jammed and now there is a pic of usb and an arrow to itunes logo. I've restarted the phone several times, but it just goes to that same screen when the ph