{"id":67,"date":"2011-10-10T16:23:20","date_gmt":"2011-10-10T16:23:20","guid":{"rendered":"http:\/\/www.edcortes.ph\/?p=155"},"modified":"2021-07-11T08:00:22","modified_gmt":"2021-07-11T08:00:22","slug":"using-code-to-make-applications-do-things-part-1","status":"publish","type":"post","link":"https:\/\/emcortes.com\/?p=67","title":{"rendered":"Getting Started with VBA in Excel 2010 (Part 1)"},"content":{"rendered":"<div id=\"section69\">\n<div>\n<h4>Using Code to Make Applications Do Things<\/h4>\n<p>You might think that writing code is mysterious or difficult, but the basic principles use every-day reasoning and are quite accessible. The Office 2010 applications are created in such a way that they expose things called <em>objects<\/em> that can receive instructions. You interact with applications by sending instructions to various objects in the application. These objects are many, varied, and flexible, but they have their limits. They can only do what they are designed to do, and they will only do what you instruct them to do. Below are some of the important concepts that you must learn to start writing VBA Codes:<\/p>\n<\/div>\n<h4>Objects<\/h4>\n<div>\n<p>Programming objects relate to each other systematically in a hierarchy called the <em>object model<\/em> of the application. The object model roughly mirrors what you see in the user interface; for example, the Excel object model contains the <strong>Application<\/strong>, <strong>Workbook<\/strong>, <strong>Sheet<\/strong>, and <strong>Chart<\/strong> objects, among many others. The object model is a conceptual map of the application and its capabilities.<\/p>\n<\/div>\n<h4>Properties and Methods<\/h4>\n<div>\n<p>You can manipulate objects by setting their <em>Properties<\/em> and calling their <em>Methods<\/em>. Setting a property changes some quality of the object. Calling a method causes the object to perform some action. For example, the <strong>Workbook<\/strong> object has a <strong>Close<\/strong> method that closes the workbook, and an <strong>ActiveSheet<\/strong> property that represents the sheet that is currently active in the workbook.<\/p>\n<\/div>\n<h4>Collections<\/h4>\n<div>\n<p>Many objects come in both singular and plural versions\u2014Workbook and Workbooks, Worksheet and Worksheets, and so on. The plural versions are called <em>collections<\/em>. Collection objects are used to perform an action on multiple items in the collection. Later on, this article discusses how to use the <strong>Worksheets<\/strong> collection to change the name of each worksheet in a workbook.<\/p>\n<p>Source: <a href=\"http:\/\/msdn.microsoft.com\/\">http:\/\/msdn.microsoft.com\/<\/a><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Using Code to Make Applications Do Things You might think that writing code is mysterious or difficult, but the basic principles use every-day reasoning and are quite accessible. The Office 2010 applications are created in such a way that they expose things called objects that can receive instructions. You interact with applications by sending instructions [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,4],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-excel","category-programming-notes"],"_links":{"self":[{"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emcortes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":1,"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":343,"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions\/343"}],"wp:attachment":[{"href":"https:\/\/emcortes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emcortes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emcortes.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}