Board index » delphi » How to translate Excel VB Code to Delphi Code

How to translate Excel VB Code to Delphi Code

I'm trying to collect the number of "name" (or "bookmark") in MS Excel
and the name of each
"bookmark".

In Excel VB:

set nms = ActiveWorkbook.Names
set wks = Worksheets(1)
for r = 1 to nms.count
    wks.cells(r,2).value  = nms(r).name
    wks.cells(r,3).value  = nms(r).referstorange.Address
next

I don't know how to translate between VB code and  Delphi OLE Call?

 

Re:How to translate Excel VB Code to Delphi Code


It's basically the same in Delphi, except that you use [] instead of ()
to refer to the various indexed properties.  (I assume you know how to
get a reference to Excel and so on.)

Other Threads