Control Structures (part II) Stefano Grazioli
Critical Thinking Many 0s – do not worry! IF you got a zero you get to re-do: submit with today’s homework. We will regrade. EasyMeter
VS - Optional own computer install The following has a high success rate, but it is not a guaranteed solution. Make sure Visual Studio and all other Microsoft programs are closed Open Control Panel. Click “Programs and Features”. In the left sidebar, click “View Installed Updates” At the very top-right of the Uninstall an Update screen, type the following into the Search box: KB3115135. There may be one or more entries labeled Security Update for Microsoft Office 2016 (KB3115135). Select and click Uninstall. Uninstall them all. Now, reopen Visual Studio and you should be able to create a VSTO workbook. On the McIntire domain, we have blocked this update from all machines. Home users won’t be so lucky; this update may come back again in the future. Students can download the “Show or Hide Updates” tool from Microsoft to permanently block KB3115135: https://support.microsoft.com/en-us/help/3183922/how-to-temporarily-prevent-a-windows-update-from-reinstalling-in-windows-10
You Do The Talking Name Learning objectives What you like about the class so far What can be improved Attitude towards the Tournament?
Loops for Repetitive Tasks Control Structures Loops for Repetitive Tasks
Loops – For … Next For i As Integer = 1 To 10 Step 1 next Application.ActiveCell.Offset(i, 0).Value = i * 100 next
Loops – For Each For Each myCell As Excel.Range in Application.Range("A1:B4") myCell.Value = myCell.Value * 2 Next
Loops – Do Loop 1 Do ‘ body of the loop Loop While <test>
Loops – Do Loop 2 Do While <test> ‘ body of the loop Loop
What Is New In Technology? WINIT What Is New In Technology?
Object-Oriented (OO) VB and VBA are OO languages Almost everything is an object Object = methods() + properties Properties can store other objects Class is a description (code) for an object Instance is a specific working object in your computer
Dot notation The dot allows us to “look inside” programming items (e.g., a class). Go from “known” to “specific”. myTempRange.Borders.Color = Drawing.Color.LightGray myTempRange.Interior.Color = Drawing.Color.DarkBlue
H4
Suggestions Submit carefully Email me. Come and see me. Office hours on web site.