Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
.



Reply
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
How can I print only select sheets in my workbook? MVictoreen New Users to Excel 2 March 28th 08 10:21 PM
Select method of Range fails J West Excel Programming 1 June 7th 04 02:41 PM
Copy select sheets to another Workbook Randy[_11_] Excel Programming 0 January 14th 04 05:06 PM
How do you list all the workbooks you have opened and the sheets in each workbook? Wendy[_3_] Excel Programming 1 December 5th 03 09:17 PM
Is it possible to require that a KEY NUMBER be imputed in a workbook 1 before workbook 2 can be opened? Marcello do Guzman Excel Programming 0 October 15th 03 06:29 PM


All times are GMT +1. The time now is 06:50 AM.

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

About Us

"It's about Microsoft Excel"