title: Creating a new button in Excel 2010 - howto link to code? Old ways seem prohibited
body: <p>I want my EXCEL VBA code to create a new sheet, put some stuff on it, and put a button on the sheet linked to some code I've written.  I've used Google, and found several pages describing how to programatically create a button and link it to code.  However, all the pages I've found use something like 'With ThisWorkbook.VBProject.VBComponents(ActiveSheet.CodeName).CodeModule" to insert code.</p>
  
  <p>Excel 2010 objects to this, issuing a protective message: Run-time error '1004': Programmatic access to Visual Basic Project is not trusted.</p>
  
  <p>How can I get around this?  </p>
  
  <p>Is there some other way I can link the button (which code created, just fine) to a sub I created?  I tried creating a Public Sub with the name suggested by the sample code I've found (name_Click()), but the sub never gets called.</p>