techgeek27
New Member
- Joined
- Apr 17, 2015
- Messages
- 3
HI there fellow Excel hackers.
I have an interesting issue that i have run across while trying to write a script that do a replace and find of text in excel spreadsheets.
I am writing my script in VBS because of the complexity of this script.
This script is to do the following
- search a directory for any excel file, which is well over 3000.
- Create a list of said files.
- Open each file.
- Unlock the workbook if its protected, some are some aren't and there is a possible of 9 different passwords to try.
- Go to each sheet and see if its protected,
- if so unlock it, using the same password list,
- find replace text
- lock the sheet
- go to next sheet do the same thing as before mentioned till then end of all sheets.
- end of sheets lock the workbook again.
- save
- close
- start the next file
So here i my issue.. on some workbooks, one so far on a test bunch, i get a message when it tries to do the replace.
The warning is "We couldn't find anything to replace. Click options for more ways to search." so other text.. not typing it out.
This is not a VBS message its of course an excel message.
Here the crappy thing..
I have this set so i shouldn't get any freagin alerts.
objExcel.DisplayAlerts = False
I did overcome a different warning that talked about auto update links using this.
objExcel.AskToUpdateLinks = False
But i can't figure out how to make this stupid message go away.
I can't stand by and watch this script.. it can't ask me anything..
I have an interesting issue that i have run across while trying to write a script that do a replace and find of text in excel spreadsheets.
I am writing my script in VBS because of the complexity of this script.
This script is to do the following
- search a directory for any excel file, which is well over 3000.
- Create a list of said files.
- Open each file.
- Unlock the workbook if its protected, some are some aren't and there is a possible of 9 different passwords to try.
- Go to each sheet and see if its protected,
- if so unlock it, using the same password list,
- find replace text
- lock the sheet
- go to next sheet do the same thing as before mentioned till then end of all sheets.
- end of sheets lock the workbook again.
- save
- close
- start the next file
So here i my issue.. on some workbooks, one so far on a test bunch, i get a message when it tries to do the replace.
The warning is "We couldn't find anything to replace. Click options for more ways to search." so other text.. not typing it out.
This is not a VBS message its of course an excel message.
Here the crappy thing..
I have this set so i shouldn't get any freagin alerts.
objExcel.DisplayAlerts = False
I did overcome a different warning that talked about auto update links using this.
objExcel.AskToUpdateLinks = False
But i can't figure out how to make this stupid message go away.
I can't stand by and watch this script.. it can't ask me anything..