23 June 2012

Introduction to VBA and what are VBA and how to open Visual Basic Editor


                       Hi friends, in this article I will explain about introduction to VBA and what are VBA and how to open Visual Basic Editor.

Introduction to VBA:
  • VBA is abbreviated as Visual Basic for applications.
  • Visual Basic is a language with thousands of built in functions and numerous custom modules and controls available.
  • Most people reading this VBA will probably have heard of Visual Basic, and are aware that it is a Microsoft Windows based programming language. The “for Applications” bit means that it is integrated behind the scenes in the software application you’re using, be it Word, Excel, or in our case.

       Let we know about how to open Visual Basic Editor in AutoCAD.
First open the AutoCAD application and go to tools----Macro--- Visual Basic Editor or ALT + F11.
See the below picture to know how to open the Visual Basic Editor.


Go to Insert ----User Form


Drag and drop the label and textbox from ToolBox box.Goto View—Code




Write or copy and paste the below code in the code window.

Private Sub TextBox1_Change()
MsgBox ("textbox value changing")
End Sub


Click on the play button the output is like below figure.


When you enter the text in the textbox and delete the text from textbox then the alert  “textbox value changing”  is coming .



No comments:

Post a Comment