LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Activate Workbook (Windows) with keywords

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows().Activate vs Workbooks().Activate Gary''s Student Excel Programming 4 November 6th 06 02:01 PM
Windows.Activate Steph Excel Programming 3 August 17th 06 10:18 PM
Improve 'Windows(workbook.xls).Activate" statement Hank[_6_] Excel Programming 1 May 2nd 06 02:57 PM
Workbook.Activate / Window.Activate problem Tim[_44_] Excel Programming 3 February 3rd 06 11:38 PM
can i make a formula to search keywords in a excel workbook? gorillayam Excel Worksheet Functions 0 January 15th 05 02:25 AM


All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"