![]() |
Sheets select method fails when workbook is opened by another workbook
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 |
Sheets select method fails when workbook is opened by another workbook
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 . |
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 . |
All times are GMT +1. The time now is 09:19 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com