Board index » delphi » Conversion from VB Excel macro to Delphi

Conversion from VB Excel macro to Delphi

  Is there some web site with good examples on converting a macro from
VB to Delphi code for Excel?  I also need to find out how to find the
last row/column in an excel spreadsheet.

  Emails are always welcome:  Ph...@RetailSolutions.com.

Thank you in advance!

 

Re:Conversion from VB Excel macro to Delphi


<<Phil:
Is there some web site with good examples on converting a
macro from VB to Delphi code for Excel?  I also need to
find out how to find the last row/column in an excel
spreadsheet.

Quote

http://www.djpate.freeserve.co.uk/Automation.htm
As for getting the last cell: Excel is a bit buggy in this
area, I'm afraid. If you've got a WS variable,
  WS := Excel.Activesheet as _Worksheet;
the simplest way is
  WS.UsedRange[lcid].Rows.Count;

Saving the worksheet first will update the UsedRange
property. UsedRange is known to have problems, though,
especially with Excel 2000. You could use the CurrentRange
property instead, if you knew the range concerned was
surrounded by blank rows and columns. Another way is to use
  WS.Cells.SpecialCells(xlCellTypeLastCell,
                               EmptyParam).Row;

--
Deborah Pate

Other Threads