EXCEL.APPLICATION

Hello,
I have a problem, I want to use the EXCEL.APPLICATION for opening an Excel file, but I want the user gets the control of the edition of that file and  SAP waits to continue executing when user closes the file.
I used another method (cl_gui_frontend_services=>execute) but for some reasons this function doesn't usefull for me, althought this one waits the end of execution of Excel to continue executing the program.
I would like if anyone can tell me how I can use EXCEL.APPLICATION (a method or property) so I can open the file and continue with abap execution only when user closes the file.
Thanks in advance.
regards
My code until now:
  DATA: excel1 TYPE ole2_object,
        workbooks1 TYPE ole2_object,
        libro TYPE ole2_object.
  CREATE OBJECT excel1 'EXCEL.APPLICATION'.
*Make the excel application visible
  SET PROPERTY OF excel1 'Visible' = 1.
  CALL METHOD OF excel1 'Workbooks' = workbooks1.
  SET PROPERTY OF excel1 'DisplayAlerts' = 0.
Open Pattern
  CALL METHOD OF workbooks1 'Open' = libro
    EXPORTING
      #1 = g_file.

Hello,
After openning your Excel book, you can show a popup (a message type I for example) and then when the user accepts the code will continue the execution, saving the file and closing it, as SAP does when you see an Excel format when yo see data table in SE16 and passes to Excel.
For example:
  MESSAGE i001(za) WITH text-001.
  CALL METHOD OF libro 'Save'.
  CALL METHOD OF libro 'Close'.
After the message you can execute an popup function module for asking if you want to save the changes, and then you can decide if execute SAVE method or not.
I hope this can help you.
Regards.
Edited by: Luis Rubio on Nov 20, 2008 1:09 PM

Similar Messages

  • SharePoint PowerShell script to open Excel.Application on Windows server 2008 R2

    Hi
    I am building a PowerShell script to open an Excel file store on SharePoint document library.  Sound simple enough but I just couldn't get over an error and hopefully someone can help give an answer here.
    I have found many sample codes to use.  All of the sample codes show that a new object must be created for Excel application
    like ($Excel = New-Object -comobject Excel.Application) before that excel file can be read.
    When I run this comand on a SharePoint server (Windows 2008 R2) either inside the script or by itself I keep getting the following error:
     New-Object : Cannot load COM type Excel.Application.
    + $excel = New-Object <<<<  -Com Excel.Application
        + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
    For the test,  I ran this comand on a Windows 7 with MS Office applications installed,  then it ran fine.
    Is that because I don't have Office application (Excel) installed on the server to run this or some services need to be turned on?
    From the sample codes, look like I should be able to run it on the Server with SharePoint installed.
    Thanks for any advice or solution to resolve my issue.
    Swanl

    So I'm assuming this won't return anything either?
    Get-WMIObject Win32_ClassicCOMClassSetting | ? {$_.VersionIndependentProgId -like 'excel.application'}
    You need Office/Excel installed on the server because you're accessing those .DLLs for the automation functionality, but depending on what you're trying to do you may be able to use one of the office viewers:
    http://www.microsoft.com/en-us/download/details.aspx?id=10 although I'm not sure how much of the com (if any) is exposed in a viewer install.  if Office is not possible due to
    budget reasons, I believe there are several 3rd party providers who can produce a com object that will handle Excel formats.

  • Invalid method "Save As" from Excel application object

    I have Windows 2000 and Excel 2002 installed on my machine.
    I down loaded "renamed Excel 2000 workbook.vi" from NI website. Relinked ref num to Excel application object but get the error of invalid method (Save As). Tried to relink invoke node to Save As by selecting method from drop down menu. However this method is not on the list. Tried other excel objects but can not find "Save As" method. Has this been removed/moved?

    I was able to correct the error by relinking the Workbooks->Open to Open. This changes the subsequent Invoke Node from IAppEvents to _Workbook. There you will find the Save As method.
    Michael
    www.abcdefirm.com
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • How to Use AccessibleObjectFromWindow API in VBA to Get Excel Application Object from Excel Instance Window Handle

    I need to get the Excel.application object from a window handle using AccessibleObjectFromWindow. I can't seem to make the code work. First, I successfully search for the XLMAIN windows. Then, when I get a handle, I execute the AccessibleObjectFromWindow
    function. It seems to return a value of -2147467262 in all cases. Therefore, I believe that it is returning an error value. I can't figure out how to determine the meaning of this value.
    If it is an error value, I believe that one or more arguments are in error. My best guess at present is that the GUID argument is incorrect. I have tried two GUID values: {00020400-0000-0000-C000-000000000046} and {90140000-0016-0409-0000-0000000FF1CE}.
    I have seen both used in conjunction with OBJID_NATIVEOM. Neither one seems to work. I really would prefer not to use the second one as it has an Excel major and minor version number. I would hate to have to change this code, if a new minor version appeared.
    The attached code has been commented to show which parts have been shown to work and which not. I'm at my wits end and really need help.
    Thanks
    'This module is located in Access 2010, but this is an Excel question.
    Option Compare Database
    Option Explicit
    ' Module-Level Declarations
    'The GetDesktopWindow function and FindWindowEx function work just fine.
    Public Declare Function GetDesktopWindow Lib "user32" () As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, _
    ByVal hWnd2 As Long, _
    ByVal lpsz1 As String, _
    ByVal lpsz2 As String) _
    As Long
    'I'm not getting the expected output from this function (see below)
    Private Declare Function AccessibleObjectFromWindow& Lib "oleacc.dll" _
    (ByVal hwnd&, _
    ByVal dwId&, _
    riid As GUID, _
    xlwb As Object)
    Type GUID
    lData1 As Long
    iData2 As Integer
    iData3 As Integer
    aBData4(0 To 7) As Byte
    End Type
    Function ExcelInstances() As Long
    ' Procedure-Level Declarations
    ' Value of OBJID_NATIVEOM verified by checking list of Windows API constants _
    on this site: http://www.lw-tech.com/q1/base.htm
    Const OBJID_NATIVEOM = &HFFFFFFF0
    Dim hWndDesk As Long 'Desktop window
    Dim hWndXL As Long 'Child window
    Dim objExcelApp As Object 'Final result wanted: Excel application object
    'Following variable (xlapp) to be set by AccessibleObjectFromWindow function
    Dim xlapp As Object
    Dim IDispatch As GUID 'GUID used in call to AccessibleObjectFrom Window function
    'Set up GUID to be used for all instances of Excel that are found
    Dim tmp1 As Variant 'Return value from AccessibleObjectFromWindow
    ' Executable Statements
    SetIDispatch IDispatch
    IDispatch = IDispatch
    'Get a handle to the desktop
    hWndDesk = GetDesktopWindow 'This seems to work
    Do
    'Get the next Excel window
    'The following statement seems to work. We are finding and counting _
    correctly all the instances of Excel. hWndXL is non-zero for each _
    instance of Excel
    hWndXL = FindWindowEx(GetDesktopWindow, hWndXL, "XLMAIN", vbNullString)
    'If we got one, increment the count
    If hWndXL > 0 Then
    'This works. We correctly count all _
    instances of Excel
    ExcelInstances = ExcelInstances + 1
    'Here is the problem. The following statement executes and returns a value of _
    -2147467262. xlapp, which is passed by reference to AccessibleObjectFromWindow, _
    is set to nothing. It should be set to the object for Excel.application. _
    I believe that this value is not an object. I tried to reference tmp1. in the _
    immediate window. There was no Intellisense.
    'I think that the function in returning an error value, but I can't figure _
    out what it is. I believe that AccessibleObjectFromWindow returns error _
    values, but I don't know where to find their values so I can interpret the _
    function's results.
    'As best I can tell, the hWndXL parameter is correct. It is the handle for _
    an instance of Excel. OBJID_NATIVEOM is set correctly (see constant declaration _
    above). xlapp is passed by reference as a non-initialized object variable, which _
    will be set by AccessiblObjectFromWindow. IDispatch may be the problem. It is set _
    as shown below in the procedure SetIDispatch(ByRef ID As GUID). This procedure _
    appears to work. I can see that IDispatch is set as I intended and correctly _
    passed to AccessibleObjectFromWindow.
    tmp1 = AccessibleObjectFromWindow(hWndXL, OBJID_NATIVEOM, IDispatch, xlapp)
    'Need to write code to test tmp1 for error. If none, then set objExcelApp = _
    object. Also, I exect xlapp to be set to Excel.application
    End If
    'Loop until we've found them all
    Loop Until hWndXL = 0
    End Function
    Private Sub SetIDispatch(ByRef ID As GUID)
    'Defines the IDispatch variable. The interface _
    ID is {90140000-0016-0409-0000-0000000FF1CE}.
    'NOT USING {00020400-0000-0000-C000-000000000046}, _
    which could be the problem
    '9 is release version - first version shipped (initial release)
    '0 is release type - retail/oem
    '14 is major version
    '0000 is minor version
    '0016 is product ID - MS Excel 2010
    '0409 is language identifier - English
    '0 is x86 or x64 - this is x86
    '000 reserved
    '0 is debug/ship
    '000000FF1CE is office family ID
    With ID
    .lData1 = &H90140000
    .iData2 = &H16
    .iData3 = &H409
    .aBData4(0) = &H0
    .aBData4(1) = &H0
    .aBData4(2) = &H0
    .aBData4(3) = &H0
    .aBData4(4) = &H0
    .aBData4(5) = &HF
    .aBData4(6) = &HF1
    .aBData4(7) = &HCE
    End With
    End Sub
    DaveInCalabasas

    I don't think you can return a reference to Excel's main window like that as you are attempting to do.
    Ref:
    http://msdn.microsoft.com/en-us/library/windows/desktop/dd317978(v=vs.85).aspx 
    It's relatively straightforward to return any workbook's window in any given instance, and in turn it's parent Excel app. Try the following and adapt as required (and include error handling) -
    Option Explicit
    Private Declare Function FindWindowEx Lib "User32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
    ByVal lpsz2 As String) As Long
    Private Declare Function IIDFromString Lib "ole32" _
    (ByVal lpsz As Long, ByRef lpiid As GUID) As Long
    Private Declare Function AccessibleObjectFromWindow Lib "oleacc" _
    (ByVal hWnd As Long, ByVal dwId As Long, ByRef riid As GUID, _
    ByRef ppvObject As Object) As Long
    Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(7) As Byte
    End Type
    Private Const S_OK As Long = &H0
    Private Const IID_IDispatch As String = "{00020400-0000-0000-C000-000000000046}"
    Private Const OBJID_NATIVEOM As Long = &HFFFFFFF0
    Sub test()
    Dim i As Long
    Dim hWinXL As Long
    Dim xlApp As Object ' Excel.Application
    Dim wb As Object ' Excel.Workbook
    hWinXL = FindWindowEx(0&, 0&, "XLMAIN", vbNullString)
    While hWinXL > 0
    i = i + 1
    Debug.Print "Instance_" & i; hWinXL
    If GetXLapp(hWinXL, xlApp) Then
    For Each wb In xlApp.Workbooks
    Debug.Print , wb.Name
    Next
    End If
    hWinXL = FindWindowEx(0, hWinXL, "XLMAIN", vbNullString)
    Wend
    End Sub
    'Function GetXLapp(hWinXL As Long, xlApp As Excel.Application) As Boolean
    Function GetXLapp(hWinXL As Long, xlApp As Object) As Boolean
    Dim hWinDesk As Long, hWin7 As Long
    Dim obj As Object
    Dim iid As GUID
    Call IIDFromString(StrPtr(IID_IDispatch), iid)
    hWinDesk = FindWindowEx(hWinXL, 0&, "XLDESK", vbNullString)
    hWin7 = FindWindowEx(hWinDesk, 0&, "EXCEL7", vbNullString)
    If AccessibleObjectFromWindow(hWin7, OBJID_NATIVEOM, iid, obj) = S_OK Then
    Set xlApp = obj.Application
    GetXLapp = True
    End If
    End Function
    Note as written if an instance does not have any loaded workbooks a reference will not be returned (though a workbook can be added using DDE, but convoluted!)
    FWIW there are two other very different approaches to grab all running Excel instances though something along the lines of the above is simplest.
    Peter Thornton

  • Ole excel application from abap

    Hi all ,
               I   an calling  one excel application  from abap .  I   don't want to make excel file visible ,  but insted  want to save and close the file , by using method
    saveas for excel application  and later i want to see the file . file name i want to store in a variable .
    eg :
    CALL METHOD OF H_EXCEL 'FILESAVEAS' = RC
    EXPORTING #1 =  filename .
    Can it be possible ?
    regards,
    SA

    hi
    i simpler method will be to use the function modules for this purpose.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
             PROGRAM_NAME        = SYST-CPROG
             DYNPRO_NUMBER       = SYST-DYNNR
             FIELD_NAME          = ' '
             IMPORTING
               file_name           = file_name .
              lc_filename = file_name.
              CALL FUNCTION 'GUI_DOWNLOAD'
                EXPORTING
                BIN_FILESIZE                    =
                  filename                        = lc_filename
                  filetype                        = 'DAT'
                TABLES
                  data_tab                        = gt_itab.
              IF sy-subrc <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
    Fn module F4_filename will prompt for the name of the file to be saved  and GUI_DOWNLOAD will save the file.
    gt_itab is the internal table containing the data to be stored in excel.

  • Problem opening excel application, it opens all the workbooks at the at once!

    Why everytime I open or start excel application, it opens and open many excel books at the same time! Is this an excel configuration problem? How can I just open excel and start a new excel book, without opening the rest of saved excelbooks?

    Thanks LousyFool. With the help of an Apple store expert finally resolved the problem by eliminating the excel hidden folder. It happens that the excel folder resides in the library folder, and after he deleted it and open excel app it then creates a brand new empty folder. By eliminating the old excel folder the excel files that were opened automatically it fixed the problem!
    Thank for your help

  • Excel Application Unable to Connect the Highavailable(Mirrorining) database

    Hi Folks,
    Please help me out from below Issue.
    We have developed an Excel application to pull data from Back-end Database.
    The database is configured in High availability Mirroring, When fail over occurs the Database moving from One server DB to Another Server DB.
    But my Excel application is not pointing to the Failover DB when the One DB fails.
    We are using the below Connection string in the excel application:
    *"Data Source=Server A;Failover Partner=Server B; Initial Catalog=AdventureWorks; Integrated Security=True;"*
    When Server A is unavailable, it shows the below error.
    PFA : Error.jpg
    And again asking for Authentication
    PFA : Authentication.jpg
    Here we need to Enter Credentials manually and then it is able to connect the desired database.
    But it is not possible to spread credentials to end –user.
    Can anyone please provide solution for this issue to automate the above scenario without manual intervention?
    Thanks in Advance 

    make sure that "sun.jdbc.odbc.JdbcOdbcDriver" is on your classpath ,

  • Urgent: CLIENT_OLE2.CREATE_OBJ('Excel.Application') get error

    My OS is Window server 2003, Office 2003, Oracle Form 10G
    I have installed Webutil successfully.
    Before using webutil I had tried this command: OLE2.Create_Obj('Excel.Application'). It had worked fine but when I using webutil. I replace above command with this command: Client_OLE2.Create_Obj('Excel.Application')I have gotten error.
    I don't know why. Could you help me, plz.
    Thank so much.

    More information, I see this exception in java console:
    Exception occurred during event dispatching:
    java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.jacob)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkLink(Unknown Source)
         at java.lang.Runtime.loadLibrary0(Unknown Source)
         at java.lang.System.loadLibrary(Unknown Source)
         at com.jacob.com.Dispatch.<clinit>(Dispatch.java)
         at oracle.forms.webutil.ole.OleFunctions.create_obj(OleFunctions.java:513)
         at oracle.forms.webutil.ole.OleFunctions.getProperty(OleFunctions.java:218)
         at oracle.forms.handler.UICommon.onGet(Unknown Source)
         at oracle.forms.engine.Runform.onGetHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

  • EXCEL APPLICATION - WORK SHEET UPDATION

    Hi All,
    1. How to open an excel application which is on the application server ?
        If not local file.??
    2. How to look for a particular worksheet ( Worksheet name is fixed here )?
        There are 20 worksheet in my excel file.
    3. How to update the particular worksheet ( Columns are fixed ) ?
        While updating, today i will update the worksheet1 till 20 rows, tomorrow i want to start from 21st row.
    Thanks in advance .
    Expecting replies.
    Regards
    Vijay

    Hi Vijay,
    Refer the links. Not sure if it answers all your questions.
    http://sap.ittoolbox.com/code/d.asp?d=3127&a=s
    or to
    http://sap.ittoolbox.com/code/d.asp?d=3126&a=s
    or to
    http://sap.ittoolbox.com/code/d.asp?d=3027&a=s
    you can also check
    http://sap.ittoolbox.com/code/d.asp?d=1614&a=s
    These links were extracted from ITToolbox Sap source code exchange( http://sap.ittoolbox.com/code/d.asp?whichpage=1&pagesize=10&i=10&a=c&o=&t=&q=&qt= )
    This pages are a free resource of code from other abappers who kindly share their knowledge to us.
    >
    <b>Multiple excel sheets generation in a workbook</b>
    CREATE OBJECT EXCEL 'EXCEL.SHEET'.
    GET PROPERTY OF EXCEL 'Application' = APPLICATION.
    SET PROPERTY OF APPLICATION 'Visible' = 1.
    CALL METHOD OF APPLICATION 'Workbooks' = BOOKS.
    CALL METHOD OF BOOKS 'Add' = BOOK.
    CALL METHOD OF BOOK 'WORKSHEETS' = SHEET.
    CALL METHOD OF SHEET 'ADD'.
    Fill all the sheets with relavant data
    PERFORM SHEET1 TABLES ITAB1.
    PERFORM SHEET2 TABLES ITAB2.
    PERFORM SHEET3 TABLES ITAB3.
    PERFORM SHEET4 TABLES ITAB4.
    Quit the excel after use
    CALL METHOD OF EXCEL 'QUIT'.
    FREE OBJECT: COLUMN,SHEET,BOOK,BOOKS,APPLICATION,EXCEL. "NO FLUSH.
    CLEAR V_SHEET.
    FORM FILL_CELL USING ROW COL VAL.
    CALL METHOD OF SHEET 'cells' = CELL NO FLUSH
    EXPORTING #1 = ROW #2 = COL.
    SET PROPERTY OF CELL 'value' = VAL.
    FREE OBJECT CELL NO FLUSH.
    ENDFORM. " FILL_CELL
    FORM SHEET1 TABLES ITAB1 STRUCTURE ITAB1.
    V_SHEET = Sheet Name.
    V_NO = V_NO + 1.
    CALL METHOD OF BOOK 'worksheets' = SHEET NO FLUSH EXPORTING #1 = V_NO.
    SET PROPERTY OF SHEET 'Name' = V_SHEET NO FLUSH.
    PERFORM FILL_SHEET1 TABLES ITAB1 USING V_NO V_SHEET.
    CALL METHOD OF SHEET 'Columns' = COLUMN.
    FREE OBJECT SHEET.
    CALL METHOD OF COLUMN 'Autofit'.
    FREE OBJECT COLUMN.
    ENDFORM.
    Repeat above procedure for all sheets you want to add
    FORM FILL_SHEET1
    TABLES ITAB1 STRUCTURE ITAB1
    USING V_NO V_SHEET.
    ROW = 1.
    PERFORM FILL_CELL USING ROW 1 'Column1 Name'.
    PERFORM FILL_CELL USING ROW 2 'Column2 Name'.
    PERFORM FILL_CELL USING ROW 3 'Column3 Name'.
    ROW = ROW + 1.
    LOOP AT ITAB1.
    PERFORM FILL_CELL USING ROW 1 ITAB1-Column1.
    PERFORM FILL_CELL USING ROW 2 ITAB1-Column2.
    PERFORM FILL_CELL USING ROW 3 ITAB1-Column3.
    ROW = ROW + 1.
    ENDLOOP.
    ENDFORM.
    Repeat above procedure for all sheets you want to add
    <b>UPLOAD EXCEL into Internal Table</b>
    Use FM ALSM_EXCEL_TO_INTERNAL_TABLE
    TYPES:
    BEGIN OF ty_upload,
    field1 TYPE c length 12,
    field2 TYPE c length 12,
    field3 TYPE c length 12,
    END OF ty_upload.
    DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.
    DATA wa_upload TYPE ty_upload.
    DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.
    FIELD-SYMBOLS: <wa> type alsmex_tabline.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = filename
    i_begin_col = 1
    i_begin_row = 1
    i_end_col = 3
    i_end_row = 65535
    TABLES
    intern = itab.
    LOOP AT itab ASSIGNING <wa>.
    CASE <wa>-col.
    WHEN '0001'.
    wa_upload-field1 = <wa>-value.
    WHEN '0002'.
    wa_upload-field2 = <wa>-value.
    WHEN '0003'.
    wa_upload-field3 = <wa>-value.
    ENDCASE.
    APPEND wa_upload TO it_upload.
    CLEAR wa_upload.
    ENDLOOP.
    **********another way*******
    TYPE-POOLS truxs.
    tables : ztable.
    types: begin of t_tab,
    col1(5) type c,
    col2(5) type c,
    col3(5) type c,
    end of t_tab.
    data : itab type standard table of t_tab,
    wa type t_tab.
    data it_type type truxs_t_text_data.
    parameter p_file type rlgrap-filename.
    data ttab type tabname.
    at selection-screen on value-request for p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = SYST-CPROG
    DYNPRO_NUMBER = SYST-DYNNR
    FIELD_NAME = 'P_FILE'
    IMPORTING
    FILE_NAME = p_file
    start-of-selection.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_FIELD_SEPERATOR =
    I_LINE_HEADER = 'X'
    i_tab_raw_data = it_type
    i_filename = p_file
    tables
    i_tab_converted_data = itab[]
    EXCEPTIONS
    CONVERSION_FAILED = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    end-of-selection.
    loop at itab into wa.
    ztable-col1 = wa-col1.
    ztable-col2 = wa-col2.
    ztable-col3 = wa-col3.
    modify ztable.
    endloop.
    Reward points if this Helps.
    Manish

  • OLE Automation EXCEL.APPLICATION OPEN === CSV file

    Hi Gurus,
    no probs to open a XLS file via
          CREATE OBJECT grc_excel 'EXCEL.APPLICATION'.
          SET PROPERTY OF grc_excel  'VISIBLE' = 1.
          CALL METHOD OF grc_excel 'WORKBOOKS' = grc_wbook.
    Open Workbook
          CALL METHOD OF grc_wbook 'Open'
            EXPORTING #1 = gfd_filename.
    but how to deal with CSV ? They're opened not properly.
    I tried #2 = 'CSV' but no luck.
    Any Idea?
    Cheers
    carsten

    COMMA separated files are SEMICOLON separated files in German Windows systems.
    This ist set in Windows System settings for regions (enhanced).
    EXCEL considers this settings when running normally. CSV is stored with ; and will be loaded properly after.
    In OLE mode, EXCEL does not consider this regional setting and expects COMMA
    If there's no option to tell lthe open method of OLE-Excel, I must translate SEMICOLIN toCOMMA before with all risks to translate text instead of separators...
    I saw some opens with #2 as parameter for "read only" but nothing regarding "separator character" (CL_RMPS_MS_OFFICE_TOOLS~GET_BUILTIN_DOC_PROPS_FROM_FIL)
    Thanks & Cheers
    carsten

  • Excel application - can't remove from memory

    I'm opening and reading a worksheet using the Excel application/reference methods from Labview.  Worked fine until some short time ago where now all my sheets are opened up as "read-only".  Worse yet, when I try to close the sheet and Quit excel application, task mgr shows it is still resident in memory.
    This worked well until our IT department added some Microsoft updates.  Any ideas?

    I'm guessing the microsoft updates have somehow set the files to be read only now. I'd find the files on your disk and check their properties. As for it being resident in memory, is the reference still open? I'm not sure if this would cause this issue, but it may. Make sure you close any references relating to your file when you are done with them, then close the file.
    CLA, LabVIEW Versions 2010-2013

  • Problem is releasing excel application from memory using webutil

    Hi Experts,
    This code is working fine but it is not releasing the excel from the memory. if i try the same set of code with Wort.Applicationa or Access.Application it works fine. But only with excel it is not working.
    Is there is any way to kill the excel application?
    application := CLIENT_OLE2.create_obj('Excel.Application');
    CLIENT_OLE2.invoke(application,'Quit');
    CLIENT_OLE2.release_obj(application);
    Thanks & Regards
    Rajesh

    This is probably <Bug:3082119 which is fixed in the production release.
    Regards
    Grant Ronald
    Forms Product Management

  • OLE : EXCEL.APPLICATION

    Hello All,
    I am trying to download data to excel using EXCEL.APPLICATION.
    But I am not able to find any place where I can see the all Attributes of Excel listed together.
    Like if I want to format the cell of excel what Attribute is to be changed.
    Please let me know in detail about EXCEL.APPLICATION, I have checked the threads but could not find any details on this.
    Thanks a lot.
    Ruchi

    Hi
    See this code.. it has all the colors
    <b>report  zkris_ole2.
    type-pools ole2 .
    data:  count type i,
           count_real type i,
           application type ole2_object,
           workbook type ole2_object,
           excel     type ole2_object,
           sheet type ole2_object,
           cells type ole2_object.
    constants: row_max type i value 256.
    data index type i.
    data:
          h_cell        type ole2_object,        " cell
          h_f           type ole2_object,        " font
          h_int         type ole2_object,
          h_width       type ole2_object,
          h_columns     type ole2_object,
          h_rows        type ole2_object,
          h_font        type ole2_object,
          h_entirecol   type ole2_object.
    create object excel 'EXCEL.APPLICATION'.
    if sy-subrc ne 0.
      write: / 'No EXCEL creation possible'.
      stop.
    endif.
    set property of excel 'DisplayAlerts' = 0.
    call method of excel 'WORKBOOKS' = workbook .
    set property of excel 'VISIBLE' = 1.
    * creating workbook
    set property of excel 'SheetsInNewWorkbook' = 1.
    call method of workbook 'ADD'.
    call method of excel 'WORKSHEETS' = sheet
      exporting
      #1 = 1.
    set property of sheet 'NAME' = 'Color Palette'.
    call method of sheet 'ACTIVATE'.
    data: col type i value 1,
    row type i value 2,
    col1 type i value 2,
    col_real type i value 1.
    row = 1.
    col = 2.
    call method of excel 'Cells' = h_cell
      exporting
      #1 = row
      #2 = col.
    set property of h_cell 'Value' = 'No.'.
    col = col + 1.
    call method of excel 'Cells' = h_cell
      exporting
      #1 = row
      #2 = col.
    set property of h_cell 'Value' = 'Background'.
    col = col + 1.
    call method of excel 'Cells' = h_cell
      exporting
      #1 = row
      #2 = col.
    set property of h_cell 'Value' = 'Foreground with white background'.
    col = col + 1.
    call method of excel 'Cells' = h_cell
      exporting
      #1 = row
      #2 = col.
    set property of h_cell 'Value' = 'Foreground with black background'.
    call method of excel 'Rows' = h_rows
      exporting
        #1 = '2:2'.
    set property of h_rows 'WrapText' = 1.
    col = 8.
    call method of excel 'Cells' = h_cell
      exporting
      #1 = row
      #2 = col.
    set property of h_cell 'Value' = 'No.'.
    col = col + 1.
    call method of excel 'Cells' = h_cell
      exporting
      #1 = row
      #2 = col.
    set property of h_cell 'Value' = 'Background'.
    col = col + 1.
    call method of excel 'Cells' = h_cell
      exporting
      #1 = row
      #2 = col.
    set property of h_cell 'Value' = 'Foreground with white background'.
    set property of h_cell 'Bold' = 1.
    col = col + 1.
    call method of excel 'Cells' = h_cell
      exporting
      #1 = row
      #2 = col.
    set property of h_cell 'Value' = 'Foreground with black background'.
    call method of excel 'Rows' = h_rows
      exporting
        #1 = '1:1'.
    set property of h_rows 'WrapText' = 1.
    get property of h_rows 'Font' = h_font.
    set property of h_font 'Bold' = 1.
    count = 1.
    count_real = count.
    row = 2.
    col = 2.
    do 56 times.
      perform write_num_and_color.
    enddo.
    * autofit
    call method of excel 'Columns' = h_columns
      exporting
        #1 = 'B:K'.
    get property of h_columns 'EntireColumn' = h_entirecol.
    set property of h_entirecol 'Autofit' = 1.
    *&      Form  write_num_and_color
    *       text
    form write_num_and_color.
    " write the color number
      index = row_max * ( row - 1 ) + col.
      call method of sheet 'Cells' = cells
        exporting
        #1 = index.
      set property of cells 'Value' = count_real.
    " write the color as the background
      col = col + 1.
      call method of excel 'Cells' = h_cell
        exporting
        #1 = row
        #2 = col.
      get property of h_cell 'Interior'   = h_int.
      set property of h_int  'ColorIndex' = count_real.
    " write the color as the foreground with a white background
      col = col + 1.
      call method of excel 'Cells' = h_cell
      exporting
        #1 = row
        #2 = col.
      set property of h_cell 'Value' = 'Sample Text'.
      get property of h_cell 'Font'    = h_f.
      set property of h_f 'ColorIndex' = count_real.
    " write the color as the foreground with a black background
      col = col + 1.
      call method of excel 'Cells' = h_cell
      exporting
        #1 = row
        #2 = col.
      get property of h_cell 'Interior'   = h_int.
      set property of h_int  'ColorIndex' = 1.
      set property of h_cell 'Value' = 'Sample Text'.
      get property of h_cell 'Font'    = h_f.
      set property of h_f 'ColorIndex' = count_real.
      row = row + 1.
      col = col - 3.
      count = count + 1.
      if count = 29.
        count = 1.
        row = 2.
        col = col + 6.
      endif.
      count_real = count_real + 1.
    endform.                    "write_num_and_color</b>

  • Reports in MS Excel Application

    Hi, All,
    We are using Oracle 10g database and forms. We have installed Jinitiator version 1.3.1.22.
    We are generating some of the reports in MS Excel Application from the Oracle forms.
    To generate the report in excel format we are using Client_OLE2 command.
    Recently we got a client machine with windows 7 OS with IE 10.
    In this client machine once we open the report opening screen and select the report format as Excel the Runtime application is getting expired.
    In this case we have to close entire internet explorer.
    The same report is opening in other format like PDF and HTML.
    This is a very very important requirement to us.
    Please help me.
    Regards,
    Tulasi

    submit Service  Request to MOS

  • Error  when instantiating a Com( EXCEL.APPLICATION) object in WINDOWS XP

    Hi,
    I am using coldfusion MX7 and OS is WindowXP. I am using COM
    object with Excel.Application for my program. but it is giving the
    below error. But same program is working in Window Profesional.
    ERROR IS:
    An exception occurred when instantiating a Com object.
    The cause of this exception was that: AutomationException:
    0x80080005 - Server execution failed. Note that Windows 95 does not
    support automatic launch of a server, it must be running already.
    The error occurred in
    C:\CFusionMX7\wwwroot\XXX\report_top20.cfm: line 15
    13 : t1=now();
    14 : path=GetDirectoryFromPath(ExpandPath("*.*"));
    15 : xl=CreateObject("COM", "Excel.Application");
    16 : wbks=xl.workbooks;
    17 : tmp=wbks.open(path & "top20_template.xls");
    Plz help me.
    Reagrds,
    DRA.

    Hi,
    If possible, would you please share your Excel file with us, you can upload it to a file sharing site(Like OneDrive), and then share the link with us. Also please take a look of this article:
    http://support.microsoft.com/kb/178510
    For the warning message, It means that in Excel 2010 and Excel 2007, you can use special effects, such as transparent shadows that are not supported in Excel 97-2003. The special effects will be removed. In the Compatibility Checker, click
    Find to locate the objects that have special effects applied so that you can remove those effects as needed.
    Wind Zhang
    TechNet Community Support

Maybe you are looking for

  • ITunes 10.7.0.21 crashes when trying to open any videos.

    I have tried to repair the applicaiton which completed, but did not fix the issue.   Has any one else seen this?

  • Late 2007 MacBook Crashing

    In December when working on an iMovie project I went to add an effect to my project and my computer hung for about 30 minutes and then came up with the "hold the power button" panic message. After which iMovie and iDVD would not load at all, just bou

  • Client Side Javascript Validation not Working in Struts 1.x version

    hi, I'm following the steps provioded in the below link for Javascript Client side validation but still it is not working.I'm struggling to get this work. [http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/|http://www.visualbuilder.com/js

  • Trouble with File().mkdir()

    I don't know if this is the best forum for the question, if not, I'll be happy to repost it elsewhere. Anyway, I'm trying to learn how to create a directory using Java. So I go to lookup various examples and and all of them seem to call File().mkdir(

  • Ummmm this is the oddest thing ever.

    i downloaded the new intel updated for my mac mini and i restarted it and i left it on. when i come back my screensaver with all my itunes album cover is shaded pink. i checked all my other screen savers and they are fine. I also checked itunes and t