Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Excel:locate the last used cell (https://www.delphipraxis.net/174048-excel-locate-last-used-cell.html)

nono74 30. Mär 2013 16:33

Excel:locate the last used cell
 
hello,

I am developing an application that modifies an Excel file.

To position itself on the last line used the excel sheet, I use this code:
Delphi-Quellcode:
var
ExcelApp : Variant;
Sheet :OLEVariant;
begin
ExcelApp := CreateOleObject('Excel.Application');
 
ExcelApp.Workbooks.Open('c:\MY FILE.xls');    
 
Sheet := ExcelApp.Workbooks['c:\MY FILE.xls')].WorkSheets[1];
 
Sheet.Cells.SpecialCells(xlCellTypeLastCell, EmptyParam).Activate;
How to locate the last used cell on any row?

example : last cell Row Number => 5

thanks


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:41 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz