Highlighted
Absent Member.
Absent Member.
710 views

[archive] Add line in excell

[Migrated content. Thread originally posted on 13 November 2007]

Hello,
I need to add lines in a existing excelfile. Can anybody tell me how i can determine the last line or range in the file.
0 Likes
7 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Add line in excell

If you inquire the Worksheet object for its Rows (returning a range object), the returned range object can be inquired for its Count property I guess.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Add line in excell

With the following line I can put the cursor to the last cell.

MODIFY haExcel ActiveCell::SpecialCells(xlCellTypeLastCell)::Select()

Can you tell me how to get the rowvalue for this cell ?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Add line in excell

I don't think this will work, because it is returning you a cell object. I am not sure, but I suspect this will not tell anything about the position in the spreadsheet.
Have you tried my suggestion above?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Add line in excell

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Add line in excell

Frosti,
This is indeed the code I need. But I can't get it translated to Cobol.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Add line in excell

Frosti,
thank you very much for the link; very interesting.

Ronny,
you could use somethink like this:

inquire HExcelWks
@usedrange in HRange.

modify HRange @select()
modify HRange @specialcells(xlCellTypeLastCell)::activate()

inquire HExcelAPP @activecell::row() = TmpN

of course HRange is a handle of range and TmpN is a pic 9() that contains the rowvalue you're looking for.

Please, let me know if it works.

Ciao,
Drox
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Add line in excell

Drox,
Thank you very much, ik works fine.

🙂
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.