<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic About OLE2_OBJECT problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-ole2-object-problem/m-p/5994645#M1343215</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found a few OLE code. as follows&lt;/P&gt;&lt;P&gt;  CREATE OBJECT EXCEL_OBJ 'Excel.Application'.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;    MESSAGE E796(F9) WITH 'Can not Create Excel Object!'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CALL METHOD OF EXCEL_OBJ 'Workbooks' = WORKBOOK_OBJ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD OF WORKBOOK_OBJ 'Open' = WORKBOOK_OBJ&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      #1 = FILE_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SET PROPERTY OF EXCEL_OBJ 'Visible' = '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know how to search this value!   -  ('Workbooks',  'Open',  'Visible' )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks advanced.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2009 03:18:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-31T03:18:18Z</dc:date>
    <item>
      <title>About OLE2_OBJECT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-ole2-object-problem/m-p/5994645#M1343215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found a few OLE code. as follows&lt;/P&gt;&lt;P&gt;  CREATE OBJECT EXCEL_OBJ 'Excel.Application'.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;    MESSAGE E796(F9) WITH 'Can not Create Excel Object!'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CALL METHOD OF EXCEL_OBJ 'Workbooks' = WORKBOOK_OBJ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD OF WORKBOOK_OBJ 'Open' = WORKBOOK_OBJ&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      #1 = FILE_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SET PROPERTY OF EXCEL_OBJ 'Visible' = '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know how to search this value!   -  ('Workbooks',  'Open',  'Visible' )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks advanced.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 03:18:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-ole2-object-problem/m-p/5994645#M1343215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T03:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: About OLE2_OBJECT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-ole2-object-problem/m-p/5994646#M1343216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xiongfei,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below method is OLE method of uploading or downloading the data. &lt;/P&gt;&lt;P&gt;'Workbooks', 'Open', 'Visible'  are all OLE objects used(declared) to hold the Excel worksheet related data which belong to OLE2 type group.&lt;/P&gt;&lt;P&gt;Below is an Example as how these are used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*-- Get TAB-sign for separation of fields
  CLASS cl_abap_char_utilities DEFINITION LOAD.
  w_separator = cl_abap_char_utilities=&amp;gt;horizontal_tab.

*-- Open file in Excel
  IF w_application-header = space OR w_application-handle = -1.
    CREATE OBJECT w_application 'Excel.Application'.
    IF sy-subrc NE '0'.
      EXIT.
    ENDIF.
  ENDIF.

  CALL METHOD OF w_application 'Workbooks' = w_workbook.
  IF sy-subrc NE '0'.
    EXIT.
  ENDIF.

  CALL METHOD OF w_workbook 'Open' EXPORTING #1 = filename.
  IF sy-subrc NE '0'.
    RAISE file_open_error.
  ENDIF.

*-- Pass the tab number to be opened
  CALL METHOD OF w_application 'Worksheets' = w_sheet
    EXPORTING
    #1 = tabnumber.
*-- Check if the tab number mentioned exists in the spread sheet
  IF sy-subrc NE '0'.
*-- Free all the used Excel Objects
    PERFORM free_excel_objects.
    RAISE invalid_tab_number.
  ENDIF.

*-- Activate the sheet to be opened
  CALL METHOD OF w_sheet 'Activate'.
  IF sy-subrc NE '0'.
    EXIT.
  ENDIF.
  GET PROPERTY OF w_application 'ACTIVESHEET' = w_worksheet.
  IF sy-subrc NE '0'.
    EXIT.
  ENDIF.

*-- Mark whole spread sheet
  CALL METHOD OF w_worksheet 'Cells' = w_cell
    EXPORTING #1 = c_begin_row #2 = c_begin_col.
  IF sy-subrc NE '0'.
    EXIT.
  ENDIF.

  CALL METHOD OF w_worksheet 'Cells' = w_cell1
    EXPORTING #1 = c_end_row #2 = c_end_col.
  IF sy-subrc NE '0'.
    EXIT.
  ENDIF.
  CALL METHOD OF w_worksheet 'RANGE' = w_range
    EXPORTING #1 = w_cell #2 = w_cell1.
  IF sy-subrc NE '0'.
    EXIT.
  ENDIF.

*-- Select the data in the range
  CALL METHOD OF w_range 'SELECT'.
  IF sy-subrc NE '0'.
    EXIT.
  ENDIF.

*-- Copy marked area (whole spread sheet) into Clip board
  CALL METHOD OF w_range 'COPY'.
  IF sy-subrc NE '0'.
    EXIT.
  ENDIF.

*-- Read clipboard into ABAP
  CALL METHOD cl_gui_frontend_services=&amp;gt;clipboard_import
    IMPORTING
      data       = t_excel_tab
    EXCEPTIONS
      cntl_error = 1
      OTHERS     = 4.

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE a037(alsmex).
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;u2003&lt;/P&gt;&lt;P&gt;Where in;&lt;/P&gt;&lt;P&gt;*-- Work Fields declared to hold the Spread Sheet Data&lt;/P&gt;&lt;P&gt;  DATA: w_application  TYPE  ole2_object,&lt;/P&gt;&lt;P&gt;              w_workbook   TYPE  ole2_object,&lt;/P&gt;&lt;P&gt;              w_range          TYPE  ole2_object,&lt;/P&gt;&lt;P&gt;              w_sheet          TYPE  ole2_object,&lt;/P&gt;&lt;P&gt;              w_worksheet  TYPE  ole2_object,&lt;/P&gt;&lt;P&gt;              w_cell              TYPE  ole2_object,&lt;/P&gt;&lt;P&gt;              w_cell1            TYPE  ole2_object.&lt;/P&gt;&lt;P&gt;The values passed to the variables are fixed, ex: 'Workbooks'.&lt;/P&gt;&lt;P&gt;p_file the file from which we need to read the data.&lt;/P&gt;&lt;P&gt;p_tab is the sheet number which needs to be read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the Function Module ALSM_EXCEL_TO_INTERNAL_TABLE. &lt;/P&gt;&lt;P&gt;Please let me know if you need any further details.              &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 04:30:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-ole2-object-problem/m-p/5994646#M1343216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T04:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: About OLE2_OBJECT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-ole2-object-problem/m-p/5994647#M1343217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks your answer! &lt;/P&gt;&lt;P&gt;But i want to see where is have value of "open" "visible" etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me and give a detail example!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Advanced!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Aug 2009 14:24:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-ole2-object-problem/m-p/5994647#M1343217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-02T14:24:55Z</dc:date>
    </item>
  </channel>
</rss>

