E
Elton Law
Dear Expert,
In the past, I asked for activating the workbook with keywords ...
The fact is that my system generated file has a date at the end ..
StockPricing_21May09.xls
FXPricing_21May09.xls
BondPricing_21May09.xls
Can't activate that file with fixed scripts ... Besides, do not want to use
inputbox to input the file one by one very day ........
One expert has taught me as follows.
ActivateBookwithKeyword ("StockPrice")
Sub ActivateBookwithKeyword(strSearch As String)
For intTemp = 1 To Workbooks.Count
If InStr(1, Workbooks(intTemp).Name, strSearch, 1) <> 0 Then
Workbooks(intTemp).Activate
Exit Sub
End If
Next
End Sub
But I found if there are too many or using too much ActivateBookwithKeyword,
Excel will halt with error. Usually, it stops at somewhere unusal.
Even it stops at selecting a sheet which I can swear the sheet should be
there ...
Sheets("Conso").Select
Must the scripts above be used for 1 or 2 wokbooks only ?
Would more than 3 or 4 will windows by using activekeywords be failed ?
Do the file sequence (files being opened) matter please ?
Thanks
In the past, I asked for activating the workbook with keywords ...
The fact is that my system generated file has a date at the end ..
StockPricing_21May09.xls
FXPricing_21May09.xls
BondPricing_21May09.xls
Can't activate that file with fixed scripts ... Besides, do not want to use
inputbox to input the file one by one very day ........
One expert has taught me as follows.
ActivateBookwithKeyword ("StockPrice")
Sub ActivateBookwithKeyword(strSearch As String)
For intTemp = 1 To Workbooks.Count
If InStr(1, Workbooks(intTemp).Name, strSearch, 1) <> 0 Then
Workbooks(intTemp).Activate
Exit Sub
End If
Next
End Sub
But I found if there are too many or using too much ActivateBookwithKeyword,
Excel will halt with error. Usually, it stops at somewhere unusal.
Even it stops at selecting a sheet which I can swear the sheet should be
there ...
Sheets("Conso").Select
Must the scripts above be used for 1 or 2 wokbooks only ?
Would more than 3 or 4 will windows by using activekeywords be failed ?
Do the file sequence (files being opened) matter please ?
Thanks