Einzelnen Beitrag anzeigen

nono74

Registriert seit: 30. Dez 2012
3 Beiträge
 
#1

Excel:locate the last used cell

  Alt 30. Mär 2013, 16:33
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

Geändert von nono74 (30. Mär 2013 um 16:50 Uhr)
  Mit Zitat antworten Zitat