Skip to Content

VB Macros

Hi Experts,

I want write macros one is Global and another one is for each report. Can anybody tel me where should i write Global Macro and where should i write Report wise macro and also tel me how should i run that particular macro and where should save that. Tel me step by step i need

pls help me on this issue.

provide if any doucment help also.

Advance Thanks for all

By

ANR

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Sep 28, 2005 at 04:43 AM

    Hi ANR,

    In general,

    Macros are saved in workbooks and invoked by events (workbook refresh, for example) or by user action.

    Could you be more specific, what you are going to achieve with macros? Workbook formatting?

    Best regards,

    Eugene

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Nanda Anantha

      Hi ANR,

      If I can go back to your original question, I think you are asking: where do I put the code for a macro that will operate on EVERY query, and where do I put the code for a macro that will operate on only ONE query.

      The answer is:

      + for the routine to be run for every query, put the code in (or call the subroutine from) the subroutine named SAPBEXonRefresh

      + for the routine to be run for a particular query, put the code in (or call the subroutine from) an IF ... THEN statement within the subroutine named SAPBEXonRefresh.

      To have the routine operate on a single query, you must know the query's local name (see the Information tab in the Properties dialog for the query in Excel ... not the properties in the Query Designer). If the local name is (for example) "SAPBEXq0001", the IF ... THEN statement would read as follows:

      If queryID = "SAPBEXq0001" Then

      Call macroForQuery1

      End if

      - Pete

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2005 at 06:21 AM

    hi ANR,

    think you may write 'global' macro in a workbook and save the workbook as template workbook which's used by the other workbooks, we have ever used this to display user name insted of user id in each workbook.

    see following for how to create workbook templates http://help.sap.com/saphelp_nw04/helpdata/en/33/746e393cf65c1ae10000000a114084/content.htm

    some links for vb macros

    where-are-the-bex-variable-stored

    http://www.bwexpertonline.com/downloads/boeke04.doc

    hope this helps.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.