# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  >  Can't exit design mode because control can't be created.

## DocDeb

Opening a workbook from a template results in it opening in Design Mode. Right clicking to Open the Template, the Design Mode is not on. 
This particular Excel Template was originally created in excel 2003 with a calendar control.
When I upgraded to Excel 2007, the calendar control no longer functioned, so I used the Date Picker. Date Picker worked for many months. Now when double clicking the template the resulting excel workbook displays the message, Can't exit design mode because control 'DatePicker1' can't be created. Choose OK, and now you can click exit Design Mode and enable Macros/ActiveX. 
Saving as .xlsm from the .xltm creates a workbook that opens normally (without being in Design Mode). 
Saving the .xlsm as .xltm makes the resulting excel Template open in Design Mode.
Saved as .xlsx does not open in Design Mode, ActiveX works, macros aren't there.
Saved as .xls from .xltm does not open in Design Mode.
Saved as .xls from .xlsm does not open in Design Mode.
Saved as .xlt from .xls opens in Design Mode.
Saved as .xlt from .xltm opens in Design Mode.
I have tried this over and over with various save combinations with the results being that double clicking to open a template results in the workbook opening in Design Mode.
How can I turn it off and keep it off?

----------


## royUK

Don't use the ActiveX control, see the alternatives here

----------


## DocDeb

Sorry, my company's security won't allow me to view your site; your link is blocked. McAfee Security Rating: Red
I guess I'm SOL.

----------


## jaslake

Hi DocDeb

There's some code in this link that builds a Calendar form and demonstrates it's use in a UserForm http://www.excelforum.com/excel-prog...aturely-2.html

That same code is in the attached and demonstrates it's use in a Worksheet. The Calendar is built with and used by code...it's not an ActiveX Control.

Perhaps you can adapt the code for your use.

----------


## romperstomper

Can you post the template (without data) so we can check if it's a file or machine issue? Sounds a little like a Trust Center problem. Do you have SP2 and subsequent patches in place?

----------


## aovermille

Well, I'm am happy that I can finally help out instead of just asking questions. I encountered this same problem this morning while working on a workbook that keeps track of reporting numbers for a $2million grant that I am in charge of.  I freaked out when I couldn't get out of design mode and get the stupid thing to allow me to click the buttons that I had put in. I'm probably late to help the OP, but hopefully someone can benefits from this.  Anyway, I digress... Here is what I have found:

When I was first creating the Workbook I created several ActiveX "Testing" buttons to try out the various bits of coding. Over the course of finalizing the project, I deleted the "Testing" buttons to replace them for fully/multiple functioning ActiveX buttons. Viola!  They worked! ...... But only while it was on my PC.  It all went to crap when I moved the file to a network drive where it would be perminently housed. 

So I go back to use the Workbook and it says "Can't exit design mode becase Control 'Command Button 1' cannot be created" (or something like that).  I couldn't get out of design mode to save my life (and my job!) to use all of the fancy buttons I had put in. I took a breath, a smoke break, and then went digging.

Turns out, on some of the sheets (which have between 2-5 buttons) I had Command Button 1 as a "Tester" and Command Button 2 as the functional one.  When I deleted Command Button 1, saved it, and moved it... well, Excel couldn't wrap its head around that.  When the Workbook tried to reopen in its new home, it RENAMED Command Button #2 as #1 in the name box beside the formula bar.  In the Command Button properties menu however, it remained Command Button 2.  After looking at all of the sheets, I noticed that Excel was playing "name games" with several of my buttons.  

I tried several ways to do this, but only one way worked:
DID NOT WORK:
1. Changing the Command Button 1 name (beside the formula bar) to Command Button 2.  It just wouldn't accept the name change. It kept coing back to #1
2. Changing the Command Button 2 name (in the properties menu) to Command Button 1.  Then my VBA freaked out and said it was a redundant name and wouldn't allow it. 

WHAT DID WORK:
I changed each and every button on each and every sheet to a unique name (no more letting Excel number them for me!). Of course, I had to go back and change the CommandButton#_Click() to NewButtonName_Click().  That took a while, and at first it appeared that it did not work.  So I decided to save it, close it, and go for another smoke break. When I came back and reopened it, it worked.  Apparently Excel needed to have a fresh start on the Workbook to reset the error.

Lessons Learned:
To prevent this error ALWAYS create a UNIQUE name for each object.  Not just a caption... but the actual name itself. NEVER LET EXCEL DO IT FOR YOU!

I hope this helps someone in the future. 

Regards. -Adam

----------

