Information générale
Catégorie:
COM/DCOM et OLE Automation
Something like this:
ObjExcel= CREATEOBJECT("Excel.Application")
xlValues=-4163
xlPart=2
xlByColumns=2
with ObjExcel
.DisplayAlerts = .f.
.Visible=.t.
.Workbooks.Open(fileXLS)
.Columns("A:A").Select
lcfind="blablabla"
if .Selection.Find(lcfind, ,xlValues,xlPart, xlByColumns).Activate
?.Range("C"+trans(.ActiveCell.row)).text
endif
.Workbooks.Close()
.Quit()
endwith
ObjExcel=.NULL.
release ObjExcel
Best Wishes
>Hi All
>I have an excel workbook where i would like to do the following using automation. The excel file has data in the A B and C columns.
>I would like to search for a string in the A column
>If found, i would like to get the string from the corresponding C column.
>
>That's all!
>
>TIA
>Jaime
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement