Using Visual Basic for Applications in Microsoft Project Sean Vogel.

Slides:



Advertisements
Similar presentations
Integrated Business Applications with Databases (D3) Jenny Pedler
Advertisements

Using VB with MS Applications R. Juhl, Delta College.
Excel and Visual Basic. Outline Data exchange between Excel and Visual Basic. Programming VB in Excel.
Essence of programming  Branching  Repetitions.
Visual Basic for Applications. What it does Extends the features and built in functions of Excel – Create and run VB procedures – Some may be easy to.
WORKING SMART Crystal M. Thomas Henrico County DSS (804) POSSESS Central Region Member October 31, 2007.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Using Macros and Visual Basic for Applications (VBA) with Excel
Developing an Excel Application
Tutorial 8: Developing an Excel Application
AE6382 VBA - Excel l VBA is Visual Basic for Applications l The goal is to demonstrate how VBA can be used to leverage the power of Excel u VBA syntax.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Microsoft Excel 2003 Illustrated Complete with Excel Programming.
Using the Visual Basic Editor Visual Basic for Applications 1.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Adding Automated Functionality to Office Applications.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Introduction to VBA. This is not Introduction to Excel We’re going to assume you have a basic level of familiarity with Excel If you don’t, or you need.
Customizing Microsoft Project
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Macros n Macros are little programs that you can create to automate particular tasks that you may want to execute more easily than having to specify all.
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
1 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
Automating Tasks with Visual Basic. Introduction  When can’t find a readymade macro action that does the job you want, you can use Visual Basic code.
Microsoft Excel Macros & Excel Solver (IENG490)
Enhancing User Interaction Through Programming
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
Microsoft Excel 2003 Illustrated Complete
Lecture Excel: Macros & Pivot Tables. Macros A macro is a series of commands that are stored and can be run whenever you need to perform the task.
Spreadsheets in Finance and Forecasting Presentation 9 Macros.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
Visual Basic for Applications Macro Programming For Microsoft Office.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
The Object Model Visual Basic for Applications 2.
Key Applications Module Lesson 21 — Access Essentials
TUTORIAL 9 INSTRUCTOR: HANIF ULLAH ID: OFFICE #: 2029 DATE: 22/04/2012 Introduction to MS Project 2007.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Chapter 9 Macros And Visual Basic For Applications.
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Microsoft Office Illustrated Introductory, Second Edition with Excel 2003 Getting Started.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Introduction to Excel VBA UNC Charlotte CPE/PDH Series December 17, 2009.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
CompMathBSc, English 5 October 2006 Programming basics — continued  Arrays  Cycle Statements: Loops  Control Structures vs Conditions  Subs: Procedures.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
SJSU College of Business Business Productivity Tools Fall 2016 Summary of Lessons and Learning Objectives.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Excel Tutorial 8 Developing an Excel Application
Exploring Excel Chapter 7 Automating Repetitive Tasks: Macros and
VBA - Excel VBA is Visual Basic for Applications
VBA - Excel VBA is Visual Basic for Applications
Excel: Macros & Pivot Tables
Microsoft Access 2003 Illustrated Complete
Microsoft Access Illustrated
Excel VBA Day 3 of 3 Tom Vorves.
Exploring Microsoft Excel
Microsoft Excel 2007 – Level 2
Visual Basic for Applications: Introduction
Presentation transcript:

Using Visual Basic for Applications in Microsoft Project Sean Vogel

Why VBA? Automate repetitive tasks –Save time –Reduce error –Impress your neighbor Calculate metrics on schedules instantly Customize Interfaces

VB Editor is located under the tools menu, macros, VB editor. This is true for every office product. Orientation to the Visual Basic Editor

Properties Window Watch Window – used in troubleshooting Main screen – used for code Debug toolbar Orientation to the Visual Basic Editor Project Explorer

Object Browser Gives you every possible variable for each Office product Orientation to the Visual Basic Editor

To control other applications you must first install the references. In the VB Editor go to the tools menu, select references. Scroll down until you find the application you want.

Programming 101 Definition Section –Define variables used in the code String – used for text Array – used to store data in 1,2,3 or more dimensional tables Boolean – true/false, used to check conditions Long – used to store numbers Code section –Sequential order of what should happen (like building a house) Pour foundation Build Walls Build Roof Charge way to much for it –Flowchart or map out any complex ideas prior to coding

Programming most used code statements –If Statement IF you want lunch THEN give me money ELSE keep your money END IF –Select Statement SELECT CASE color CASE = “red” X = 1 CASE = “blue” X = 2 END SELECT

Programming most used code statements (cont) – While Statement WHILE leave = false do this WEND –For Statement FOR = 1 to 10 write array(y) NEXT y

Define the Variables

Write the code to count tasks the late starts, off baseline tasks, and task dependencies Use this If statement to find the date that will determine if the task is late. This is the basic For Next statement we will use to loop through every task in the project. We will paste our other code within this statement.

Write the code to count tasks the late starts, off baseline tasks, and task dependencies These IF Statements check for late starts or tasks that are off their baselines. See how we nest a For Next statement to check for task dependencies within each task.

Write the Excel File This statement checks if Excel is already open. If Excel is already open you don’t want to open a second instance. We set the isrunning Boolean to true or false depending on if it is running. We will use this later.

Write the Excel File Writing things to Excel requires you to use X/Y coordinates to determine the exact cell you want to modify. The first slot is for the row index, the second for the column. These last two lines auto size the columns for better format.

Write the Excel File Now that the summary page is written let’s write the late and off baseline tasks. We must first change to another sheet. We will then use a For Next statement to write the task information.

Write the Excel File We will now write the last tab with Off Baseline Task data.

Final Steps Last, we will save the file and close Excel