Skipping Auto_Open

C

cjakeman

Hi guys,

When you use Auto_Open() to run code on opening a workbook, you can
skip this behaviour by holding down the Shift key as you open the
workbook. This works using File:Open from inside Excel.

Does anyone know how to skip this behaviour from outside Excel? For
instance, launching a workbook from Windows Explorer or from a link on
the Desktop or Start Menu.

Thanks in advance,

Chris
 
D

Dave Peterson

What happens when you hold the shift key while the file is opening (via the
double click)?
 
C

cjakeman

Hi Dave,

Dave said:
What happens when you hold the shift key while the file is opening (via the
double click)?

The Auto_Open macro executes in all of these situations, but not when I
use File:Open. I'm running WinXP SP1 and Excel 2002.
 
D

Dave Peterson

When I held down the shift key after double clicking on the filename in windows
explorer, the auto_open procedure didn't run.

I use xl2003 and winXP. But I bet it's a timing issue with your fingers. You
may want to try it a few more times.
 
C

cjakeman

Dave said:
I use xl2003 and winXP. But I bet it's a timing issue with your fingers. You
may want to try it a few more times.

Not so for me. Tried all possible variations of timing. Also behaves
the same on an old WinME/Excel 97 system.

The code has been reduced to just:
Private Sub Workbook_Open()
MsgBox ("Autostarting")
End Sub

Does anyone else see this behaviour or am I the only one? If someone
else sees it, then we might be able to find what we have in common.

PS. Thanks for responding, Dave. Much appreciated.
 
C

cjakeman

Just to say that Auto_Open() shows the same behaviour (on both PCs) as
Workbook_Open().

Found some old reports of this behaviour in the newsgroup but no
explanation or solution - see posts by Ron de Bruin in thread:
"shift key not keeping auto_open from running"
and by Andrea in thread:
"Excel 2002 VBA auto_open"

Does anyone else see this behaviour?
 
D

Dave Peterson

As a workaround, maybe you can change your macro security level to medium so
that you get prompted to allow macros. If you answer no, then no macros will
run--but that means even later if you wanted them to run, too.

(I got it to work again--yeah, I know, that doesn't help you.)
 

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