Control Structures (part II) Stefano Grazioli
Critical Thinking Homework folders are timed Keyword list / dictionary linked from the schedule EasyMeter
Visual Studio is a tool to build all sorts of apps: web, mobile, and desktop IDE = Integrated Development Environment VS 2017 is state of the art First version in 1997: multibillion $ investment Free to you: http://its.virginia.edu/software/displayPackages.php?tId=36 look for “more options” “MS imagine premium” get VS 2015 with update 3. Visual Studio Excel
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
How VS works Coding Compiling Requirements: What we want the computer to do Visual Studio Coding Compiling Source code file in a computer language Runnable program .exe, .dll C#, VB, C++
Source Code in VB
VBA editor vs. VS with VSTO VBA Editor is included in Excel Older technology Huge installed base Supported but not improved upon Has a recorder All saved within workbook Visual Studio tools for Office is included in VS Newer, way more powerful technology Growing installed base Fully supported and updated No recorder Saved in several files
You Do The Talking Name, major Learning objectives What you like about the class so far What can be improved Attitude towards the Tournament?
Control Structures Loops for Repetitive Tasks
Loops – For … Next For i As Integer = 1 To 10 Step 1 next Range(“A2”).Offset(i, 0).Value = i * 100 next
Loops – For Each Next For Each myCell As Excel.Range in 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
WINIT What Is New In Technology?
Object-Oriented (OO) VB and VBA are OO languages Almost everything is an object Object = methods() + properties Properties have values. A value can be another object 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” items. Go from “known” to “specific”. Range(“A3:B8”).Borders.Color = Drawing.Color.LightGray Range(“A3:B8”).Interior.Color = Drawing.Color.DarkBlue
H4
Trouble? Submit carefully Come and see me. Office hours on web site.