Sign in to follow this  
Followers 0
AnuReddy

search a string in excel file

13 posts in this topic

hi guys,

i want to search a string in excel file without using path, instead using the title or the handle returned from attach, is it possible if so plz help me thru that

Share this post


Link to post
Share on other sites



Hi,

have a look at the integrated excel functions _Ex*.

;-))

Stefan

Share this post


Link to post
Share on other sites

Hi,

have a look at the integrated excel functions _Ex*.

;-))

Stefan

i could not get :mellow:

Share this post


Link to post
Share on other sites

Hi,

Helpfile -> Index -> _Ex (1st function should be _ExcelBookAttach ()).

or you mean:

You could not start coding, because you don't understand how to handle functions?

;-))

Stefan

Share this post


Link to post
Share on other sites

hmmmm after attaching it returns the handle, but for searching i need a excel path according to the syntax or _XLSearch so i want an alternative for this

Share this post


Link to post
Share on other sites

Hi,

it is still not clear what you want.

If you have the handle, you can search your opened workbook.

Maybe this is helping you:

http://www.autoitscript.com/forum/index.php?showtopic=106095&st=0&p=749335&hl=search%20excel&fromsearch=1&#entry749335

;-))

Stefan

Share this post


Link to post
Share on other sites

Hi,

it is still not clear what you want.

If you have the handle, you can search your opened workbook.

Maybe this is helping you:

http://www.autoitscript.com/forum/index.php?showtopic=106095&st=0&p=749335&hl=search%20excel&fromsearch=1&#entry749335

;-))

Stefan

ok let me explain:

i am actually downloading a file, which is an excel file

so it asks for options: open, close and cancel

when i click on open it opens an excel file

now from that i have to search a particular string

for that i am not understanding how to proceed

i did excelattach("title of the file","title")

i want _XLSearch

but here i need to specify path, for which i dont know the path

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hi,

i don't know function _xlsearch.

Solution one:

1) I would attach an existing excel workbook. (_ExcelBookAttach)

2) Then read the sheet into array.

3) Loop over array to find value or try an _ArrayFind ()

Solution two:

1) Save the opened workbook into tempfolder with another name -> so you know fullpath to your workbook

2) Use _ExcelBookOpen () in hidden mode to open your temp workbook.

3) Then perform _XLSearch with known fullpath

;-))

Stefan

Edited by 99ojo

Share this post


Link to post
Share on other sites

Hi,

i don't know function _xlsearch.

Solution one:

1) I would attach an existing excel workbook. (_ExcelBookAttach)

2) Then read the sheet into array.

3) Loop over array to find value or try an _ArrayFind ()

Solution two:

1) Save the opened workbook into tempfolder with another name -> so you know fullpath to your workbook

2) Use _ExcelBookOpen () in hidden mode to open your temp workbook.

3) Then perform _XLSearch with known fullpath

;-))

Stefan

the functions you are talking about are from excel.au3 but i am using excelcom.au3 as a header file

Share this post


Link to post
Share on other sites

Then you include Excel.au3 as well, I don't see the problem.. ?

Share this post


Link to post
Share on other sites

Then you include Excel.au3 as well, I don't see the problem.. ?

if i include both it raises conflict

Share this post


Link to post
Share on other sites

Hi,

1) There must be a SaveAs function in excelcom.au3.

So save your excel file into temporary folder and reopen it with known path and perform your search you want to.

2) I think the conflict is the declaration of the excel constants in excel.au3 and excelcomm.au3.

You may paste and copy function parts from one to the other UDF.

;-))

Stefan

Share this post


Link to post
Share on other sites

Hi,

1) There must be a SaveAs function in excelcom.au3.

So save your excel file into temporary folder and reopen it with known path and perform your search you want to.

2) I think the conflict is the declaration of the excel constants in excel.au3 and excelcomm.au3.

You may paste and copy function parts from one to the other UDF.

;-))

Stefan

hi stefan,

i did it now its working fine :mellow: thanks a lot

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0