How to: Simple User Interface WMCUG 13 th Jan 2010 Gord Vander Vliet Enterprise Tool & Die, LLC Jeff Roark Johnson Controls.

Slides:



Advertisements
Similar presentations
Sep-05 Slide:1 VBA in Excel Walter Milner. Sep-05 Slide:2 VBA in Excel Introduction VBA = Visual Basic for Applications Enables end-user programming In.
Advertisements

Information System Design Lab 5&6. User Interface Design.
MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
Using VB with MS Applications R. Juhl, Delta College.
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
XP New Perspectives on Microsoft Excel 2003, Second Edition- Tutorial 8 1 Microsoft Office Excel 2003 Tutorial 8 – Developing an Excel Application.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
How to get started with Excel VBA. We need to enable programming in Excel  the “Developer menu”
Automating Tasks With Macros
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.
CREATE THE DIFFERENCE Before you start Please press F5 to run this show.
Other Features Index and table of contents Macros and VBA.
ME 142 Engineering Computation I Macros. Key Concepts Macro Overview Recording a Macro Running a Macro Editing a Macro Using Controls.
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Introduction to Excel VBA University of Chicago Graduate School of Business Introduction to Computer Based Models Bus Mr. Schrage Spring 2003.
University of Toronto at Scarborough © Andria Hunter, Kersti Wain-Bantin CSCA01 VBA-3 1 Lecture Outline Variable Scope Calling another subprogram Programming.
IN THE NAME OF ALLAH UserForms on VBA Lab 06 Tahani Al_dweesh.
Introduction to Engineering Computing GEEN 1300 Lecture 7 15 June 2010 Review for midterm.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 6 Multiple Forms.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Ch 11: Userforms CP212 Winter Topics Designing User Forms o Controls Setting Properties o Tab Order o Testing Writing Event Handlers o Userform_Initialize.
1 Visual Basic for Applications (VBA) for Excel Prof. Yitzchak Rosenthal.
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Systems Module Slide 2 – Overview and Navigation
2. Recording a Macro. Macro Recording Select Record Macro from the Macro file menu and the dialog box opposite will appear Your macro will require a name.
ME 142 Engineering Computation I Macros. Key Concepts Macro Overview Recording a Macro Running a Macro Editing a Macro.
Active-HDL Interfaces Debugging C Code Course 10.
Chapter Two Creating a First Project in Visual Basic.
How to get started with Excel VBA. We need to enable programming in Excel  the “Developer menu”
CSD 340 (Blum)1 Using Visual Studio CSD 340 (Blum)2 Start/Microsoft Visual Studio 2005/Microsoft Visual Studio 2005.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Introduction to ArcGIS for Environmental Scientists Module 3 – GIS Analysis Model Builder.
1 MIS309 Database Systems Introduction to Microsoft Access.
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
Creating Macros in Excel Adding Automated Functionality to Excel & Office Applications.
Engineering\CADD Systems Office CADD Manager's Series Customizing the Interface.
ME 142 Engineering Computation I Using Subroutines Effectively.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Introduction to Excel VBA UNC Charlotte CPE/PDH Series December 17, 2009.
More Form Tools Combo Box (displays a list) Check Box (yes/no) Frame (groups option buttons) Option Button (exclusive choice) Ref Edit (user selects cells)
CS 281 – Fall 2015 Lab 4 Parametric Query and Forms in MS Access.
As we upgrade from ImageNow 6.1 to ImageNow 6.3, there are some changes to the interface that the end-users will see. These slides cover changes to the.
Juanita Cano City of Sacramento Spring 2014 Geography 375.
Crystal Reports with MDS  Topics  Crystal Reports  Sales Analysis Reports  Export Crystal Report to different formats  Modify and Save New Reports.
Chapter 2: Excel Basics and Formatting Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Introduction to Matlab Module #10 Page 1 Introduction to Matlab Module #10 – Creating Graphical User Interfaces Topics 1.Overview of GUI Development using.
Microsoft PowerPoint Prepared by the Academic Faculty Members of IT.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
CS 281 – Fall 2010 Lab 4 Parametric Query and Forms in MS Access.
Financial Information Management VB, VBA, VS, VSTO & VBE: Putting it all together Source: Excel VBA Programming by John Walkenbach.
Using Forms and Form Elements In Visual Basic.NET.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Working with UserForms Dr Joanna Wyrobek 1. Displaying a modeless UserForm By default, UserForms are displayed modally. This means that the UserForm must.
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.
Power Copy and UDF Automation Jeff Roark Johnson Controls
VBA Excel Macro 1.Create a Macro: To create a macro in Excel VBA, Create a Macro: To create a macro in Excel VBA,Create a Macro: To create a macro.
The Advantage Series ©2005 The McGraw-Hill Companies, Inc. All rights reserved Chapter 12 Introducing Visual Basic for Applications Microsoft Office Excel.
IE 8580 Module 4: DIY Monte Carlo Simulation
5. Using databases in VB.
Introduction to VB6 Week 1 3/2/2004 PPCC - Introduction to VB6
Microsoft Office Illustrated
Excel VBA Day 3 of 3 Tom Vorves.
UserForm.
Lesson 1 - Automating Tasks
Custom Forms with VBA in Excel In-Class Exercise #11
Presentation transcript:

How to: Simple User Interface WMCUG 13 th Jan 2010 Gord Vander Vliet Enterprise Tool & Die, LLC Jeff Roark Johnson Controls

Two Example CATIA VBA Form Excel Design Table

VBA Forms Pros No Links to maintain Executed from Macro No Synchronization Cons Used by CATIA expert VBA knowledge required Requires naming convention

Design Table Example Pros Does not require CATIA to change values Everyone knows Excel Cons Requires CATIA to update the model

VBA User Interface Create a Parametric Part Define Parameters required for the UI Create a VBA form

VBA User Interface Create a VBA Project Create New or Add an Existing catvba project

VBA User Interface Insert – UserForm Design the UI TextBox Buttons Coding – Module Run form the Macro function in CATIA Coding Load the UI

VBA User Interface View UI Code

VBA User Interface View UI Object

VBA User Interface Insert – Object resolution Select a CATIA Parameter to insert the needed VBA code

VBA User Interface Free VBA code!

VBA User Interface Add an “TextBox” Name it – Block_LengthTextBox

VBA User Interface Assign the Parameter value to the TextBox When the VBA UI is started it will get the Parameter Value from CATIA and assign the value to the TextBox in VBA UI. Should look like this. VBA has will provide popup dialog boxes to help you along the way

VBA User Interface Ready to Test the UI with CATIA Parameter value is assigned to the TextBox Next step is to be able to change the value from the TextBox and assign that value to the CATIA Parameter.

VBA User Interface Original Code -Remove the length1 form the Private Sub UserForm1 -Added length1 as a Public variable so it’ s value can be used in both Subs

VBA User Interface Ready to Test the UI with CATIA Parameter value is assigned to the TextBox Change the TextBox Value and Click the Button After the Part is updated the Parameter value shows the new value form the TextBox

VBA User Interface Sub CATMain() MsgBox "Hello CATIA Users" UserForm1.Show End Sub Final Example with copy/paste code Module1

VBA User Interface Public length1 As Length Private Sub enterBtn_Click() length1.ValuateFromString Block_LengthTextBox.Value Unload UserForm1 End Sub Private Sub UserForm_Activate() '---- Begin resolution script for object : Block_Length Dim partDocument1 As PartDocument Set partDocument1 = CATIA.ActiveDocument Dim part1 As Part Set part1 = partDocument1.Part Dim parameters1 As Parameters Set parameters1 = part1.Parameters Set length1 = parameters1.Item("Block_Length") Block_LengthTextBox.Value = length1.ValueAsString '---- End resolution script End Sub UserForm1

Excel UI Form

Create CATPart with required Parameters Create a Design Table Create a Excel VBA Form

Excel UI Form Double Click on the Design Table Click Edit Table Access the Excel File

Excel UI Form Make a Button

Excel UI Form Create a Macro – View Tab – Click Macro – Type a Name – Click Create

Excel UI Form Rt Click on the Button to assign it to a Macro

Excel UI Form Insert a Module Insert a UserForm

Excel UI Form Add the code in the Module to Show the Form UserForm1.Show will display the form when the macro is launched.

Excel UI Form Add the TextBox, Button, and Image

Excel UI Form Add a Background image Add Textbox and Button using the Toolbox

Excel UI Form Add this code to the UserForm

Excel UI Form When the form is Activated assign Cell values to TextBox

Excel UI Form Click the Enter Button to assign TexBox values to Cell