<?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 Excel Range.End property in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-range-end-property/m-p/7313792#M1535884</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to find the end of my spreadsheet without looping through every row.  I can do this in VBA as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Selection.End(xlDown)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to implement in ABAP like this.  I have omitted the code where I set the selection, that is working &amp;amp; verified by setting my Excel application Visible.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CONSTANTS: c_xldown VALUE -4121.
DATA: w_xlrng TYPE ole2_object, w_xlendrng TYPE ole2_object.
GET PROPERTY OF w_xlrng 'End' = w_xlendrng
  EXPORTING
  #1 = c_xldown.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above code sets SY-SUBRC to 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to implment this capability?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Sep 2010 13:02:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-14T13:02:37Z</dc:date>
    <item>
      <title>Excel Range.End property</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-range-end-property/m-p/7313792#M1535884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to find the end of my spreadsheet without looping through every row.  I can do this in VBA as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Selection.End(xlDown)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to implement in ABAP like this.  I have omitted the code where I set the selection, that is working &amp;amp; verified by setting my Excel application Visible.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CONSTANTS: c_xldown VALUE -4121.
DATA: w_xlrng TYPE ole2_object, w_xlendrng TYPE ole2_object.
GET PROPERTY OF w_xlrng 'End' = w_xlendrng
  EXPORTING
  #1 = c_xldown.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above code sets SY-SUBRC to 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to implment this capability?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Sep 2010 13:02:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-range-end-property/m-p/7313792#M1535884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-14T13:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Range.End property</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-range-end-property/m-p/7313793#M1535885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can we know the reason for this.&lt;/P&gt;&lt;P&gt;May based on your requirement some other opition we can given.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Sep 2010 14:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-range-end-property/m-p/7313793#M1535885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-14T14:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Range.End property</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-range-end-property/m-p/7313794#M1535886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved my own problem, which was caused by incorrect constant definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CONSTANTS: c_xldown    TYPE i VALUE -4121.

    " (code omitted) ... open file, position selection at row &amp;amp; column where data starts
    GET PROPERTY OF w_xlrng 'End' = w_xlendrng
      exporting
      #1 = c_xldown.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem was, without &lt;U&gt;TYPE i&lt;/U&gt;, the default data type was &lt;U&gt;c&lt;/U&gt;, which resulted in incorrect information being sent to Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My overall goal is to read a very large Excel spreadsheet into a table without running out of memory - I was getting short dumps when the system was unable to extend internal table space.  The End(xlDown) property wasn't absolutely required, but I wanted to provide the user some feedback as to how we're progressing by counting rows before actually processing them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Sep 2010 15:04:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-range-end-property/m-p/7313794#M1535886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-14T15:04:07Z</dc:date>
    </item>
  </channel>
</rss>

