Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I print only select sheets in my workbook? | New Users to Excel | |||
Select method of Range fails | Excel Programming | |||
Copy select sheets to another Workbook | Excel Programming | |||
How do you list all the workbooks you have opened and the sheets in each workbook? | Excel Programming | |||
Is it possible to require that a KEY NUMBER be imputed in a workbook 1 before workbook 2 can be opened? | Excel Programming |