macro to exit design mode

C

cm

I am creating protected worksheets for users. When some users open them,
their Excel is already in Design Mode.

I need code to 'exit' design mode automatically. Can anyone advise please?
 
J

john

see if this helps:

Sub ExitDesignMode()

With CommandBars("Exit Design Mode").Controls(1)
If .State = msoButtonDown Then .Execute
End With

End Sub
 
C

cm

one more thing - need this to run on workbook_open -- get an error of 'with
block variable not set' -- what do I need to edit?



cm
 
J

john

keep the procedure in standard module and call it from open event

Private Sub Workbook_Open()
Call ExitDesignMode
End Sub
 

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