General information
Category:
COM/DCOM and 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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only