no focus when spreadsheets opens

G

Greg

I have a spreadsheet that contains macros. When I go to windows
explorer and double click the spreadsheet file, depending on the
current state of excel, the spreadsheet is gains or does not gain
focus. If excel is not running or is minimized, the spreadsheet comes
up (after the "enable macros security warning" dialog box) in focus.
But the way I work this is rarely the case. Usually, excel is running
and has 0 or more spreadsheets opened when I go to explorer to open
the next sheet. When I open the next sheet, I get the macro security
message and then the spreadsheet opens out of focus, either behind
explorer if excel is behind it or with no indication of it opening if
explorer of another application is maximized on top of non-minimized
excel.

How can I make it so that when I double click on a spreadsheet in
explorer, it comes up in focus?

Hint: This behavior has not always existed. I've just started
writing macros via VBA (as opposed to merely recording and running)
and know just enough about them and VBA to be dangerous. I think I
may have damaged, added, or altered something in the VBA screen that
made this start to happen.

Hint: This behavior does not happen when I open spreadsheets with no
macros as long as there is at least one other spreadsheet opened.

Thanks for any help you can offer.

Greg
 
C

Chip Pearson

Greg,

I've seen similar things happen when the VBA Editor is open when
double-clicking on a file. Do you have the VBA Editor open when you open the
workbook in Explorer?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
G

Greg

Yes, as a matter of fact, the VBA editor is open. I closed the editor
just now, but the strange behavior remains.

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top