{"id":942,"date":"2013-01-20T19:17:16","date_gmt":"2013-01-20T17:17:16","guid":{"rendered":"http:\/\/www.samlogic.net\/blog\/?p=942"},"modified":"2019-07-07T22:17:09","modified_gmt":"2019-07-07T22:17:09","slug":"how-to-add-an-activex-component-to-an-excel-2010-sheet","status":"publish","type":"post","link":"https:\/\/www.samlogic.net\/blog\/2013\/01\/how-to-add-an-activex-component-to-an-excel-2010-sheet\/","title":{"rendered":"How to add an ActiveX component to an Excel 2010 sheet"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignright\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-components-calendar\/scc-calendar-jan-2013.gif\" alt=\"1 month calendar\" border=\"0\">In the <a href=\"https:\/\/www.samlogic.net\/blog\/2013\/01\/how-to-add-an-activex-component-to-a-visual-basic-2010-project\/\">previous blog post<\/a> we described how to add an ActiveX component (control) to a Visual Basic 2010 project. In this blog post we will describe how to insert an ActiveX component in an Excel sheet. We will show the necessary steps to include an ActiveX component in a sheet in <strong>Microsoft Excel 2010<\/strong>. We will use the same calendar component as in the previous blog post  in this step-by-step example (we will use the one month calendar from <a href=\"https:\/\/www.samlogic.net\/components-calendar\/calendar.htm\">SamLogic Calendar Components<\/a>).<\/p>\n<p><strong>How to add an ActiveX component to an Excel 2010 sheet<\/strong><\/p>\n<p>1. Start Microsoft Excel 2010.<\/p>\n<p>2. First make sure that the <strong>Developer<\/strong> tab is visible in the Ribbon interface. If not, follow the steps (A-E) below:<\/p>\n<p>A. Open the <strong>File<\/strong> tab in the Ribbon.<br \/>\nB. Select <strong>Options<\/strong>.<br \/>\nC. Choose <strong>Customize Ribbon<\/strong>.<br \/>\nD. Check the <strong>Developer<\/strong> checkbox.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-components-calendar\/customize-ribbon.gif\" alt=\"Customize Ribbon - Developer\" border=\"0\"><\/p>\n<p>E. Close the <strong>Excel Options<\/strong> dialog box. The <strong>Developer<\/strong> tab in the Ribbon interface should now be visible.<\/p>\n<p>3. Open the <strong>Developer<\/strong> tab.<\/p>\n<p>4. Click on the <strong>Insert Controls<\/strong> option.<\/p>\n<p>5. Click on the <strong>More Controls<\/strong> option in the <strong>ActiveX Controls<\/strong> group.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-components-calendar\/ribbon-insert-controls.gif\" alt=\"Developer - Insert Controls - More Controls\" border=\"0\"><\/p>\n<p>6. From the control list in the <strong>More Controls<\/strong> dialog box, choose the <strong>SamLogic SLXCal Control<\/strong> control and press the <strong>OK<\/strong> button.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-components-calendar\/dlgbox-more-controls.gif\" alt=\"More Controls\" border=\"0\"><\/p>\n<p>7. A cross-like cursor will now appear. Click somewhere in the sheet to specify the calendar component\u2019s position in the sheet.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-components-calendar\/calendar-in-sheet.gif\" alt=\"The calendar component in an Excel sheet\" border=\"0\"><\/p>\n<p>The calendar component should now appear in the sheet as shown in the picture above.<\/p>\n<p>That\u2019s all steps that we need. We have now added an ActiveX component to an Excel sheet!<\/p>\n<p><strong>Events<\/strong><br \/>\nThe calendar component is event driven, so if you want to open up an event handler for the calendar you can double-click on the calendar component. The <strong>DateChanged<\/strong> event handler will now be shown in a code window.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-components-calendar\/excel-code-window.gif\" alt=\"The code window in Microsoft Excel\" border=\"0\"><\/p>\n<p>If you click on the dropdown list in the upper right of the code editor you can choose another event handler, for example the <strong>DateSelected<\/strong> event handler. The <strong>DateChanged<\/strong> event is fired when a user changes month in the calendar and the <strong>DateSelected<\/strong> event is fired when a user clicks on a date (day number) in the calendar.<\/p>\n<p><strong>Properties<\/strong><br \/>\nYou can set some properties for the calendar component before it is used. If you switch back to the Excel sheet with the calendar and right-click on the calendar and choose the <strong>Properties<\/strong> menu item in the local menu that is shown, you will find a list with properties for the calendar component. If you want to set any properties before any code is executed you can set them here.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.samlogic.net\/blog\/images\/product-components-calendar\/calendar-component-properties.gif\" alt=\"Properties\" border=\"0\"><\/p>\n<p>After the execution of the code has started, you can change properties for the calendar component programmatically.<\/p>\n<p><strong>More information about the one month calendar component<\/strong><br \/>\nMore detailed information about the one month calendar component in SamLogic Calendar Components, including a complete list of all properties, events and methods in the component, is available on this web page:<\/p>\n<p><strong><span style=\"color: #ff0000;\">&gt;<\/span><\/strong> <a href=\"https:\/\/www.samlogic.net\/components-calendar\/slcalendx.htm\">One-Month Calendar Component (ActiveX)<\/a><\/p>\n<p><strong>In the next blog post<\/strong><br \/>\nIn the <a href=\"https:\/\/www.samlogic.net\/blog\/2013\/01\/how-to-install-and-register-an-activex-component\/\">next blog post<\/a> we will show how to install an ActiveX component in a Windows system. Just copying an ActiveX component to a computer\u2019s hard disk is not enough; no, it needs also to be registered in the system. And it is important that the component is installed in the correct folder on the hard disk, otherwise a software using the component may get problem finding the component. In the next blog post we will describe the process of installing an ActiveX component in a Windows system closer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous blog post we described how to add an ActiveX component (control) to a Visual Basic 2010 project. In this blog post we will describe how to insert an ActiveX component in an Excel sheet. We will show the necessary steps to include an ActiveX component in a sheet in Microsoft Excel 2010. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.samlogic.net\/blog\/2013\/01\/how-to-add-an-activex-component-to-an-excel-2010-sheet\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to add an ActiveX component to an Excel 2010 sheet&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"_links":{"self":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/942"}],"collection":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/comments?post=942"}],"version-history":[{"count":1,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/942\/revisions"}],"predecessor-version":[{"id":6170,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/posts\/942\/revisions\/6170"}],"wp:attachment":[{"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/media?parent=942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/categories?post=942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samlogic.net\/blog\/wp-json\/wp\/v2\/tags?post=942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}