How to call Visual basic MACRO code in ABAP

Hi all,
I created one MACRO in Microsoft office and now i want to call this macro in my ABAP program.
How to do this can anyone provide me the logic for this....
Regards.

What Office application/document has the macro?  What the other poster was referring to is that you can open any type of Office document, E-mail editor, PDF document, simply by executing the filename or appropriate shell command.  By opening the Office document that has the embedded macro, you would trigger that macro to execute.  Is that what you need?
Here is a simple example (with a hard-coded filename):
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
  EXPORTING
    DOCUMENT               = 'C:\temp\mydoc.doc'
  EXCEPTIONS
    CNTL_ERROR             = 1
    ERROR_NO_GUI           = 2
    BAD_PARAMETER          = 3
    FILE_NOT_FOUND         = 4
    PATH_NOT_FOUND         = 5
    FILE_EXTENSION_UNKNOWN = 6
    ERROR_EXECUTE_FAILED   = 7
    SYNCHRONOUS_FAILED     = 8
    NOT_SUPPORTED_BY_GUI   = 9
    OTHERS                 = 10.
As I mentioned, this is also useful for triggering other applications, such as your resident e-mail editor, based on a click of an e-mail address in a GUI screen:
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
    EXPORTING
      DOCUMENT               = 'mailto:(put address here)'
    EXCEPTIONS
      CNTL_ERROR             = 1
      ERROR_NO_GUI           = 2
      BAD_PARAMETER          = 3
      FILE_NOT_FOUND         = 4
      PATH_NOT_FOUND         = 5
      FILE_EXTENSION_UNKNOWN = 6
      ERROR_EXECUTE_FAILED   = 7
      SYNCHRONOUS_FAILED     = 8
      NOT_SUPPORTED_BY_GUI   = 9
      OTHERS                 = 10.

Similar Messages

  • How to call Visual Basic Component's method (DLL)in Java

    Hi people ,
    I need to make calls to methods from a dll . Why ? because the main project is in java and I am a java developer . This dll is the API of an other system that we need to access .
    I have searched this on google as you normally do . I found Jacob and some examples using javah . But all the references are old . The latest file I downloaded (version 1.5) was written in 2004 .
    Like wise all the results I get on google are old like from 2000 and even 2001 . What are standard practices for this now a days . The dll is written in Visual Basic .
    Any help will be appreciated .

    mycoffee wrote:
    Shahzeb wrote:
    Hi people ,
    I need to make calls to methods from a dll . Why ? because the main project is in java and I am a java developer . This dll is the API of an other system that we need to access .
    I have searched this on google as you normally do . I found Jacob and some examples using javah . But all the references are old . The latest file I downloaded (version 1.5) was written in 2004 .
    Like wise all the results I get on google are old like from 2000 and even 2001 . What are standard practices for this now a days . The dll is written in Visual Basic .
    Any help will be appreciated .That is history
    Why do you need a method in VB? everything vb can do, java can do better :JK
    Need more information to know what are you going to doWell that's an invain argument but I agree in principle .
    That DLL is not my code , it is api for some other application that we need to access . A system written by some other company whose API is exposed to us in a DLL . I need to use that simple as that .

  • How to call visual basic exe file from LABVIEW 7.1

    Hi all,
    I would like to call a visual basic 6.0 application(executable file) from labview 7.1 kindly anyone is having code or papers send me.
    Thanks and Regards
    rajesh

    Hi all,
    i would like to run a visual basic programme from labview , i have attached my file , even though iam executing the programme iam not able execute the vb file , kindly suggest me ,
    Regards
    rajesh
    Attachments:
    active x.vi ‏18 KB

  • Running Visual Basic macro

    Can I run a Visual Basic macro from Java? How do I do that?

    If your macro can be invoked from the command line, then you should be able to run it by using Runtime.exec()

  • Visual Basic Macros

    Hi,
    I'm interested in created Visual Basic macros for my report. So i'm looking for samples/guides.
    I was reading through the "Desktop Intelligence Access and Analysis Guide" and have come to a point where it says:
    Programming in Visual Basic requires knowledge of the programming environment. This is covered in the Customizing Desktop Intelligence guide.
    Does anyone have any clue where I can find this document? i couldn't find it here:
    http://help.sap.com/
    Thanks, much would be appreciated!!

    (I had trouble logging in to my account so i had to create a new account.)
    Hi Sarbhjeet,
    Well, I followed your instructions. I went to the left panel, clicked on "Documentation" -> Product Guides/End-user Documentation
    and it lists the following documents:
    -Desktop Intelligence Access and Analysis Guide
    -Desktop Intelligence Developer Guide
    -Desktop Intelligence Access and Analysis Guide
    -Report Coversion Tool Guide
    -Developer Library
    -Desktop Intelligence: Data Access and Analysis
    -Desktop Intelligence: Reporting Techniques and Formatting
    But I'm looking for the "Customizing Desktop Intelligence Guide". I have a feeling that this document is obsolete. =(

  • Urgent!!  How to call a custom transaction or an ABAP program in BSP?

    Urgent!!  How to call a custom transaction or an ABAP program in BSP?
    We are pretty new on BSP.  Would be very appreciated if any expert here give us the detailed steps on how to build up the application to just call a custom transaction (e.g., t-code: ztest) or an ABAP program.  Would we have to create a button or event handler to do that?  And the detailed steps?
    Thanks in advance and we will definately give you reward points!

    hi Durairaj,
    During the time to wait for your answer, we copied Bernd's code from your last link, but when activating it, get the 1st error msg:
    Field "CLIENT" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."DATA" statement. The error shows up here:
    <td>
    <htmlb:inputField id = "client"
    value = "<%= client %>" />
    </td>
    Then we added Client to the page attribute and define it as type String, then get another error:
    The field "EVENT" is unknown, but there is a field with the similar name "EVENT_ID"."EVENT_ID". This error shows up at the beginning in the Event Handler:
    OnInputProcessing:
    code
    • event handler for checking and processing user input and
    • for defining navigation
    • event handler for data retrieval
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    IF event->name = 'button' AND event->event_type = 'click'.
    button_event ?= event.
    How to resolve this unknown Event error, need to define in Page Attribute tab? but with what type?
    Actually we only want to run an ABAP4 program in BSP, the code is complicated, could you show us an easy way of doing this in BSP?

  • How To Call a Broadcasting Template within an ABAP program

    I was wondering if anyone knew how to call the Broadcast template via an ABAP program so it will execute?  The scenario that I have is we are doing validations via BW.  We put the data (for conversion reasons) through validation rules and then load a data target.  From this, there are 2 situations that could occur:
    1) There are errors
    2) There are not any errors
    If #1 is true, then I would like to execute the Query Broadcasting Template that I have created.  If #2 is true, then I would like to execute another process via the ABAP program.  In the past, I was successful using exception reporting via reporting agent, since I was able to call that program but the report did not look good at all.  Please let me know if there is a program that I could call in order to execute this broadcast that I have set up.
    Best Regards,
    Tim

    Hello,
    although this is an old threat, but do you have any hints on how to dynamically change the template when broadcasting?
    kind regards
    Murat

  • How to call a BW Query from an ABAP program?

    How to call a BW Query from an ABAP program?

    hi
    check this link
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-ii
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    hope this helps
    cheers

  • How to run a VB macros code on Query refresh?

    Hi BW gurus,
    Please help me out with this task.
    I have a macros as below
    <b>Sub Table_To_Cons()
        'Copy the occupied rows
        Application.DisplayAlerts = False
        TargetSheet = ActiveSheet.Name
        Sheets("Table").Activate
        j = 2
        For i = 21 To 65536
            If Range("F" & i).Value = "" Then
                'MsgBox "The Cell is Empty"
            Else
                f = Range("F" & i).Value
                g = Range("G" & i).Value
                Sheets("Consolidated Data").Range("A" & j).Value = f
                Sheets("Consolidated Data").Range("B" & j).Value = g
                j = j + 1
            End If
        Next
        Sheets("Consolidated Data").Activate
        MsgBox "Finished"
        ' Update Chart
        Sheets("Chart1").Select
        ActiveChart.PlotArea.Select
        ActiveChart.SetSourceData Source:=Sheets("Consolidated Data").Range("A2:B6") _
            , PlotBy:=xlRows
    End Sub</b>
    User are not interested to run the VB macros manually.
    Instead they are asking like this.The macros should run and show the latest result everytime when we refresh the query.
    Can someone help me out how to achieve this.
    Any kind of help is appreciated.
    Thanks in Advance
    Have a nice day
    Regards
    Sam Mathew

    Hi Sam,
    Very interesting that the Properties dialog has changed.  I have no experience with NW2004s.  I will answer your questions based on what I do have experience with; then, we will need to do some testing to check my assumptions.
    Your first question: does this subroutine already exists in a workbook, or do we have to manually type it in?  In the days before Excel 2002, the answer was "yes", the subroutine already exists.  Since Excel 2002, the answer is maybe.  More often than not, "no" ... and you have to type it in.
    But, whether it exists or not, you will find out when I answer yoru second question:  exactly where should I search for it?  Since you have written a macro, you already know about the Visual Basic Editor (VBE).  Since I am not sure how much you know about the VBE, I will explain it as if you know nothing.  Please do not be offended.
    As a general orientation to the Visual Basic Editor (VBE), there are 4 Windows you want to become familiar with:
    1.     the Project Explorer Window;
    2.     the Properties Window;
    3.     the Object Browser Window; and,
    4.     the Code Window.
    You should see the Project Explorer window on the left side of the VBE.  If it is not already visible, make it visible in one of 3 ways:
    i.     use the VBE menu bar and select View >> Project Explorer
    ii.     use shortcut keys Ctrl+R
    iii.     use the VBE Standard toolbar and select the icon for Project Explorer
    In the Project Explorer window you can all of the "Projects" (workbooks and add-ins), that are loaded. 
    In the view of your workbook (the one with the macro) there are at least twol groups of "objects" shown:
    •     Microsoft Excel Objects (these are Worksheets and Workbooks)
    •     Modules (I call these "General Code Modules")
    There are two other possible types of objects:
    +  Forms
    +  Class Modules
    Visual Basic Code is always written in a Code Window.  There are 3 types of code windows:
    i.     Object Code Windows
    ii.     General Code Modules
    iii.     Class Modules
    When you use the Excel macro recorder, it always creates the macro in a General Code Module.  The subroutine SAPBEXonRefresh also will be in a General Code Module. 
    To find it (if it exists), you can start in any code module in your workbook, press Ctrl+F, enter SAPBEXonRefresh, click the radio button to Search in Current Project.
    Now, to test my assumptions ... while you are in the Visual Basic Editor, with the Project Explorer Window open, please look under Microsoft Excel Objects and see if there is an object named "SAPBEXqueries".  If not, stop right there.  I cannot help you.
    If the SAPBEXqueries object is there, let me explain what it is.  This is a worksheet that is VERY hidden.  That means, it is hidden so that it cannot be made visible from Excel.  It can only be made visible from the VBE.  Let's do not now.
    Select the SAPBEXqueries object (double-click), then open the Properties window in the VBE.
    You can open the properties window using:
    +  View Properties Window
    +  press F4
    +  use the standard toolbar and click the Properties icon
    Look at the Visible property.  It should 2 - Very Hidden.  Change it to Visible.  Now switch back to the Excel view.  Look in cell F4.  What do you see in this cell?  It should be:  SAPBEXq0001, or something very similar to that.
    Now (still in Excel) open the GoTo dialog (Edit >> Go To; or, press F5).  This will list all of the Named Ranges in the workbook.  If you are on the SAPBEXqueries worksheet, the GoTo dialog should list a number of Named Ranges starting with SAPBEXq000,,,,,  Do you see this?
    I am very interested to learn what you see when you do these things.  And, I am very willing to answer any questions you have as a result of doing this testing.
    By the way, when you make the SAPBEXqueries worksheet hidden again, be careful.  As soon as you make it hidden (or very hidden), the selection in VBE will change to an object that is NOT hidden.  So, if you are not watching carefully, you might think that you are still on the SAPBEXqueries sheet and that you failed to hide it.  And, pretty soon, if you are not careful, you will have hidden every worksheet in the workbook!
    - Pete

  • How to install visual basic 6.0 in windows 8

    Hi microsoft team,
     I recently download the visual basic 6.0 in my windows 8 laptop. But it is not working properly in my system.
    When i was run the visual basic program it will show "visual basic has stopped working window is checking solution for the problem"like this.
    My program is not running. Please tell me the remedy for this kind of problem.
    Thank you

    Hello Vijayalakshmi,
    First of all, please make sure that you run the installer with elevated permissions (run as an administrator).
    Also please take a look at the
    Install Visual Basic 6 in Windows 8 guide. It describes all the required steps for installing VB6:
    1. Right click on setup.exe of your VB6 install and check Run as Administrator with XP SP 3 compatibility pack. I tried Windows 7 compatibility, it also worked.
    2. During the setup, go to components and select everything you want to install except for "Data Access". If "Data Access" is selected, the install will hang even though everything will be installed. Disabling "Data Access"
    ensures that the install completes and restarts your computer to finalize the install. Why this hangs the system is beyond me. LOL.
    3. I am using a 64bit machine, this is not supported by Microsoft and will not be supported as VB6 is 32 bit and should be hosted in 32 bit system. Thus some controls in my system didn't work. I found my listview control didn't want to burge at all.
    4. Download and install VB6 Service Pack (SP6) Runtime Extended (what??) from http://support.microsoft.com/kb/957924?wa=wsignin1.0
    5. Now you can start vb6 ide and code, everything should be mnca!
    6. Step 1 done, now to code and install my VB6 app in some WinXp, Vista and & 7 machine!!
    crossing fingers
    Finally, you may also find the
    Visual Basic 6 on Windows 8 article helpful.

  • How to install visual basics for iMac?

    HOw do I sinstall visual basics for iMac?

    If you are referring to the programming language Visual Basic from Microsoft, it is a Windows only product. You'l need to install Windows via BootCamp or virtualization to use VB.

  • How can a Visual Basic Application be used to read a Netscape LDAP server?

    I would Like to know if Visual Basic (ON AN NT WORKSTATION) can be used to access a Netscape LDAP Server (ON UNIX). And If so, will any API calls be necessary? Is there any documentation on using Visual Basic with LDAP?

    Hi Ryan,
    yes you can use VB with the nsldap32v30.dll or nsldap32v30.dll. You can get this from the iplanet page . The dll is inside the LDAP C SDK. Then, there's a 3 or 4 year old vb sdk with the declarations of the LDAP functions; but this seems not to be available in the web.
    Please send me a mail, I'll send you the doc and a sample vb prog.
    remove the nospam.
    [email protected]

  • How to call a screen /t-code by double clicking on the output of an alv?

    Hi,
    I want to call a screen /  t-code on double clicking on the output of an alv report.
    Suppose we click on a value in the "Pur Req" feild of the ALV output  it should  open the the transaction code and give us  the  details of that particular value. How can I do that?
    Thanx in advance..

    If you displaying ALV using Classes..( CL_GUI_ALV_GRID)... You need to create event receiver and register the double click event handler method dynamically.... Here's the sample code...
    *                            C L A S S E S                             *
    class lcl_event_receiver definition.
      public section.
        methods:  handle_double_click
                  for event double_click
                  of cl_gui_alv_grid
                  importing e_row e_column.
    endclass.
    *       CLASS lcl_event_receiver IMPLEMENTATION
    class lcl_event_receiver implementation.
      method handle_double_click.
        data: l_cc like line of gt_cc.
        data:
        g_row type i,
          g_value(10),
          g_col type i,
          g_row_id type lvc_s_row,
          g_col_id type lvc_s_col,
          g_row_no type lvc_s_roid.
    *  Read the double click cell
        call method gr_grid->get_current_cell
               importing
                 e_row     = g_row
                 e_value   = g_value
                 e_col     = g_col
                 es_row_id = g_row_id
                 es_col_id = g_col_id
                 es_row_no = g_row_no.
        clear wa_itab
        read table gt_itab index g_row_id into wa_itab.
        case g_col_id.
          when 'EBELN'.                   "Show Process Order
            if not wa_itab-ebeln is initial.
              set parameter id 'BES' field wa_cc-ebeln.
              call transaction 'ME22N'  and skip first screen.
            endif.
        call method gr_grid->set_table_for_first_display
            exporting
            i_consistency_check   =  g_consistency_check
            it_toolbar_excluding  =  gt_exclude
            is_variant            =  gs_variant
            i_save                =  g_save
            i_default             =  'X'
            is_layout             =  g_layout
        changing it_outtab        =  gt_cc[]
                 it_fieldcatalog  =  gt_fieldcat[]
                 it_sort          =  gt_sortcat[].
        create object event_receiver.
    *   Register the 'Double Click' event handler method dynamically.
        set handler event_receiver->handle_double_click for gr_grid.

  • How to install visual basic 6.0 to windows 8.1

    plz help I want setup vb6.0 into win8.1
    I lovw it vb6.0 and also win8.1

    Hello,
    VB 6 is no longer supported by Microsoft. I’d suggest asking in one of the following third-party forums which support Visual Basic 6.
    VB forums
    VB City
    For further information, see:
    Where to post your VB 6 questions
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • How to call codec in java code

    i want to call a jmf codec for video compression form direct capture device, i dont know how to call codecs of Jmf i am using jffmpeg how to implement it can any one please let meknow

    Lot of examples are given in the below link
    http://www.oracle.com/technology/sample_code/tech/java/jsp/oracle9ijsp.html

Maybe you are looking for

  • Lightroom imports with 100 clarity

    Hello people, i have the strange problem that lightroom imports always with 100 clarity. There is definitely something wrong with my presets, just don't know how to change that. Thanks for any suggestions, tobfl

  • Installer exits at start of installation

    Sir, I am installing on computer with following conf. OS: Windows 2000 Pro , Service Pack 3 Norton Internet Security Processor:P4 RAM:1GB Pagefile:2GB When i starts the installation it ask for path , i specify it and choose Enterprise Edition option,

  • How do I get rid of printer notifications that don't work?

    I keep getting a notification from Apple about updating my printer driver. ("Would you like to download and install software for "Samsung SCX-4623 Series"?"). When I click OK it searches for the driver but says it can't find it, and that I should try

  • App won't install due to lack of space - with enough space on the phone

    I try to install the navigation TomTom western Europe with size 1,6 gb. ITunes and phone says that I have 2,7GB free, but it refuse to install due to lack of space?

  • Clipping but sending to a bus

    I have a whole load of drum sounds on different channels with 1 channel clipping like crazy. I have bussed all the individual channels into one and then on the same channel pulled the level down a bit (so the all the combined sounds are not clipping)