auto close at start up

  • Thread starter Thread starter datacomjoe
  • Start date Start date
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
 
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
 
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
 
I could get that error if I canceled the dialog. Did you select a filename and
hit the Open button?
 
Back
Top