auto close at start up

D

datacomjoe

I have a spreadsheet that appears to automatically close when I attemp
to open it. I have tried holding down the shift key when I start Exce
and when I open the spreadsheet but no help. All I see is a quick flas
on the screen and then the spreadsheet closes. Excel remains open.
tried high security for macros but no help... any suggestions?

Jo
 
B

Bernie Deitrick

Joe,

Try the macro below. It will ask for the file's name.

HTH,
Bernie
MS Excel MVP

Sub OpenNoRun()
'This macro will open a file without running
'the auto_open macro or the open event.
Application.EnableEvents = False
Workbooks.Open FileName:=Application.GetOpenFilename
Application.EnableEvents = True
End Sub
 
D

datacomjoe

Bernie, thanks for the response.

I tried the Macro and received this error message.
 
B

Bernie Deitrick

Joe,

Are you assigning the macro to a button? You may need to set the button's
TakeFocusOnClick property to False.

Otherwise, I have never had a problem with that code.

HTH,
Bernie
MS Excel MVP
 
D

Dave Peterson

I could get that error if I canceled the dialog. Did you select a filename and
hit the Open button?
 
Top