View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default Sheets select method fails when workbook is opened by another workbook

Try putting in a 2-second wait:

Application.Wait Now + TimeValue("00:00:02")
Sheets("QueryInfo").Select

Worth a try.

--

Vasant



"Mike" wrote in message
...
I'm sorry. I forgot to mention I am using Excel 97.

Mike

-----Original Message-----
All,

Sub Workbook_Open contains the lines:

Sheets("QueryInfo").Select
Range("LastQueryUpdate").Select

These lines function properly when I open the workbook
directly. But if I open the workbook from another
workbook, the sheets select line has no effect (stepping
thru in break mode), and the range select line
subsequently fails. I tried
putting "ThisWorkbook.Activate" in the code but to no
avail. Can anyone tell me why the code doesn't work when
the workbook is opened by another workbook? What's the
fix?

TIA, Mike
.