Visual Basic for Applications: Introduction

Slides:



Advertisements
Similar presentations
Introduction to Macro Introduction to Visual Basic for Application Recording a Macro Looking at the code of Recorded Macro.
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
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
XP New Perspectives on Microsoft Excel 2003, Second Edition- Tutorial 8 1 Microsoft Office Excel 2003 Tutorial 8 – Developing an Excel Application.
MACROS CS1100 Computer Science and its Applications CS11001.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
Introduction to Visual Basic Programming. Lecture Outline History What is Visual Basic First Look at the VB 6.0 Environment Some VB Terminology Our first.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
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)
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.
Word Lesson 16 Working with Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
Microsoft Office Word 2013 Core Microsoft Office Word 2013 Core Courseware # 3250 Lesson 8: Using Productivity Tools.
Customizing Microsoft Project
Saeed Ghanbartehrani Summer 2015 Lecture Notes #2: The Visual Basic Editor The Visual Basic for Applications Programming Language IE 212: Computational.
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
Adapting a ready made PowerPoint quiz with VBA
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
1 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
NetTech Solutions Using Advanced Tools Lesson 5. NetTech Solutions Objectives Use Slide Finder Use the Format Painter Understand the purpose of macros.
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)
Introduction to VBA MGMI Aug What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven.
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
IE 411/511: Visual Programming for Industrial Applications
OCC Network Drives  H:\  P:\ 
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Chapter 9 Macros And Visual Basic For Applications.
Access Lesson 11 Creating and Running Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
Excel Macros 1 Macros or, How to Automate Part of Your Spreadsheet or Worksheet.
Introduction to Microsoft Excel Macros COE 201- Computer Proficiency.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
1 CA202 Spreadsheet Application Automating Repetitive Tasks with Macros Lecture # 12 Dammam Community College.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Dive Into® Visual Basic 2010 Express
Excel Tutorial 8 Developing an Excel Application
Microsoft Office 2010 Basics and the Internet
Microsoft Office 2010 Basics and the Internet
Exploring Excel Chapter 7 Automating Repetitive Tasks: Macros and
Chapter 2: The Visual Studio .NET Development Environment
Getting Started with Application Software
SECTION 1: Add-ons to PowerPoint
Outline In this module, the following topics will be covered:
Visual Basic Code & No.: CS 218
1. Introduction to Visual Basic
Microsoft Access Illustrated
Microsoft Office Illustrated
Microsoft Excel 2003 Illustrated Complete
Introducing VBA Macros
Exploring Microsoft® Word® 2016 Series Editor Mary Anne Poatsy
VISUAL BASIC.
Exploring Microsoft Excel
Microsoft Office Ribbon
Macro.
Microsoft Office Ribbon
European Computer Driving Licence
Microsoft Office Excel 2003
Microsoft Office Illustrated Fundamentals
Unit J: Creating a Database
Microsoft Excel 2007 – Level 2
Presentation transcript:

Visual Basic for Applications: Introduction Craig K. Tyran Western Washington University Fall 2002

Agenda Background Visual Basic for Applications (VBA) VBA Development Environment Macro Recorder Macros and Toolbars Macro Security Hands-on Exercise

A. Visual Basic: Background Beginner’s All-Purpose Symbolic Instruction Code Mid-60s: Initially created as a teaching tool Enter Microsoft … Mid-70s: Adopted/promoted a version of BASIC as a programming language for the early PCs Late-80s: Included BASIC as part of MS Word Early-90s: Modified BASIC to work with Windows environment  “Visual Basic” (VB)

A. VB: Background (cont.) 3. Visual Basic (VB) Based on BASIC programming language Added editor Added visual, graphical “controls” (e.g., command buttons, check boxes, etc.) Recent survey: VB is the most popular IS development environment 4. Visual Basic for Applications (VBA) Mid-90s: Microsoft introduced VBA  Support a standard “development environment” for MS Office products

B. VBA 1. Current status 2. Why learn VBA? Now a part of all MS Office products E.g., Excel, Access, Word, PowerPoint Non-Microsoft companies have licensed VBA to include in their applications 2. Why learn VBA? Leverage VB skills with MS Office products VBA  The standard programming language for many Windows-based desktop applications Allows one to easily customize applications for users E.g., Create a professional, user-friendly DSS using Excel Helps developers to integrate different applications E.g., Connect an Access database to an Excel-based DSS

Excel/VBA Example: User Friendly Car Loan DSS

C. VBA Development Environment VBA program code is displayed and edited in the “Visual Basic Editor” (VBE) Windows displayed inside of VBE may include: Project Explorer window Code Module window(s) Properties window Other information …

Visual Basic Editor Example

D. Excel Macro Recorder A“macro” Macro Recorder Another name for a set of VBA code statements (i.e., a VBA program) Macros can automate simple tasks A macro can be executed in several ways Use the Tools | Macro menu approach Assign a “short cut” key (e.g., ctrl-a) “Attach” macro to a toolbar button Macro Recorder A tool that automatically converts Excel keystroke/mouse actions into VBA code Can be a useful way to quickly “record” and create VBA code associated with basic Excel tasks

D. Excel Macro Recorder (cont.) The program statements created by the Macro Recorder are stored in a code “Module” inside of the Visual Basic Editor It is easy to review (and modify) the code

E. Macros and Toolbars Adding a toolbar button – and attaching a macro to a toolbar – is surprisingly easy The approach we will use Create a new toolbar Add a new toolbar button to the toolbar Attach a macro to the toolbar button Add a “Screen Tip” to the button Descriptive text that appears when cursor hovers over the button

F. Macro Security Viruses can be hidden in macros For protection, Microsoft has created a security feature which alerts a user that a macro is included with a file When opening up an Excel file, “Security Level” setting needs to be selected to enable a common macro to be included with a file Procedure to use when working with files w/macros on WWU’s PCs Open file Change security setting to “Medium” via Tools | Macro | Security Save and close file Reopen file and “Enable Macros” when prompted

E. In-class Exercise Let’s get started!!!