
VB & VBA in a Nutshell: The Language
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Table of Contents
- Preface
- Why Another VB Book?
- What's Wrong with the Online Help?
- Who Should Read This Book?
- An Emphasis on Professional VB Development
- How This Book Should Be Used
- If You're a Developer New to VB
- If You're a VB or VBA Developer
- If You're a VB or VBA Developer New to VB6
- How This Book Is Structured
- The Format of the Language Reference
- Conventions Used in This Book
- How to Contact Us
- Call for Additions and Amendments
- Acknowledgments
- Part I
- Introduction
- What Is VBA?
- How Does VBA Differ from VB?
- How Does VBA Differ from VBScript?
- How Does a VBA Program Differ from a Macro?
- A Brief History of VBA
- What Can You Do with VBA?
- Customizing and Creating Applications with VBA
- Object Models: The Power of Programming with VBA
- Program Structure
- Getting a VB Program to Run
- Running VBA Modules in Word
- Storing your code
- At startup
- When a document loads
- In response to direct user action
- Running VBA Modules in Excel
- Storing your code
- At startup
- When a document loads
- In response to direct user action
- Running VB Executables
- Using a Form at Startup
- The Form Load and Initialize events
- Using a Code Module at Startup
- The Sub Main procedure
- The Structure of a VB Program
- Events: The Starting Point
- Use Event Handlers to Call Functions and Methods
- Writing Custom Procedures
- Functions
- Sub procedures
- Property procedures
- Controlling Execution Flow
- Calling sub and function procedures
- Explicitly calling event procedures
- Ending Your VB Program
- How to End Your Program
- How a Form Unloads
- The End Statement
- VBA Variables and Data Types
- Visual Basic Data Types
- Type Conversion
- Implicit Type Conversion in VB
- The Variant
- Special Variant Data Subtypes
- Determining the Variant Subtype
- Variant and Strongly Typed Data
- Variant and Strongly Typed Functions
- Declaring Variables and Constants
- Option Explicit
- A Whole Load of Nothing
- Array Variables
- Fixed Arrays
- Dynamic Arrays
- Determining array boundaries
- Setting the lower boundary
- Multidimensional Arrays
- Dynamic multidimensional arrays
- Using UBound and LBound with multidimensional arrays
- User -Defined Types
- Variable Scope and Lifetime
- Procedure-Level Scope
- Module-Level or Private Scope
- Friend Scope
- Public Scope
- Object Variables and Binding
- Declaring Object Variables
- Early and Late Binding: Performance Comparisons
- The Collection Object
- Passing Parameters
- ByRef
- ByVal
- ByRef and ByVal: Performance
- Optional Arguments
- ParamArray
- Intrinsic Constants
- Class Modules
- Properties
- Implementing Properties
- The Anatomy of a Property
- Private member variable
- The Property Let procedure
- The Property Get procedure
- Property scope
- Implementing a User-Defined Type Property
- Implementing a Read-Only Property
- Using Properties in the Client Application
- Using a Mass Assignation Function in Collection Classes
- Enumerated Constants
- Using Enumerated Constants
- Class Module Events
- The Initialize Event
- When is the Initialize event fired?
- Using the Initialize event
- The Terminate Event
- When is the Terminate event fired?
- Using the Terminate event
- Implementing Custom Events
- Custom events applications
- Custom event rules
- Creating a custom event
- Implementing Custom Class Methods
- The Scope of Custom Methods
- Passing Arguments to Custom Methods
- Creating ActiveX Components
- In-Process Components
- Out-of-Process Components
- Class Module Properties
- Component Creation Hints and Tips
- Including user interfaces in ActiveX components
- Allowing clients to use the For Each.Next statement
- Error handling
- Use Dictionary objects rather than Collection objects
- Provide your own Exists property in collection classes
- When is an in-process component out-of-process?
- Using ActiveX Components in a Project
- Manually Registering and Unregistering ActiveX Components
- Early Binding
- Late Binding
- Automation
- Creating Object Model References
- Generic Object References and Late Binding
- Early Binding
- Reading the Object Model
- Using the Object Browser
- IntelliSense and Statement Completion
- Working with the Object Model
- Externally Createable Objects
- Navigating Through the Object Model
- Objects returned by properties
- Navigating up through the object model
- Collection Objects
- Referencing by Name or Number
- For Each.Next
- Trapping an Automation Server's Events
- Automation Examples
- Using Word as a Report Writer from VB
- Using Email Within VB
- Output from VB to Excel
- Automation Performance Tips
- Error Handling
- Building a Robust Application
- Error Handling in Procedures
- The On Error Statement
- The Exit Sub Statement
- The Err Object
- The Resume Statement
- Error Handling in ActiveX Servers
- Reporting Errors
- Reporting to the User
- Adding Help
- Silent Reporting: Logging the Error Event
- Part II
- The Language Reference
- #Const Directive
- #If...Then...#Else Directive
- Abs Function
- AddressOf Operator
- AppActivate Statement
- Array Function
- Asc, AscB, AscW Functions
- Atn Function
- Beep Statement
- BindingCollection Object (VB6)
- BindingCollection.Add Method (VB6)
- BindingCollection.Clear Method (VB6)
- BindingCollection Remove.Method (VB6)
- Binding Object (VB6)
- Calendar Property
- Call Statement
- CallByName Function (VB6)
- CBool Function
- CByte Function
- CCur Function
- CDate Function
- CDbl Function
- CDec Function
- ChDir Statement
- ChDrive Statement
- Choose Function
- Chr, Chr$, ChrB, ChrB$, ChrW Functions
- CInt Function
- CLng Function
- Close Statement
- Collection Object
- Collection.Add Method
- Collection.Count Property
- Collection.Item Method
- Collection.Remove Method
- Command Function
- Const Statement
- Cos Function
- CreateObject Function
- CSng Function
- CStr Function
- CurDir, CurDir$ Functions
- CVar Function
- CVDate Function
- CVErr Function
- Data Binding Objects (VB6)
- Data Format Objects (VB6)
- DataBindingBehavior Property (VB6 only)
- DataSourceBehavior Property (VB6 only)
- Date, Date$ Functions
- Date Statement
- DateAdd Function
- DateDiff Function
- DatePart Function
- DateSerial Function
- DateValue Function
- Day Function
- DDB Function
- Debug Object
- Debug.Assert Method
- Debug.Print Method
- Declare Statement
- Def... Statement
- DeleteSetting Statement
- Dictionary Object (VB6)
- Dictionary.Add Method (VB6)
- Dictionary.CompareMode Property (VB6)
- Dictionary.Count Property (VB6)
- Dictionary.Exists Method (VB6)
- Dictionary.Item Property (VB6)
- Dictionary.Items Method (VB6)
- Dictionary.Key Property (VB6)
- Dictionary.Keys Method (VB6)
- Dictionary.Remove Method (VB6)
- Dictionary.RemoveAll Method (VB6)
- Dim Statement
- Dir, Dir$ Functions
- Do...Loop Statement
- DoEvents Function
- Drive Object (VB6)
- Drives Collection Object (VB6)
- End... Statement
- Enum Statement
- Environ, Environ$ Functions
- EOF Function
- Erase Statement
- Err Object
- Err.Clear Method
- Err.Description Property
- Err.HelpContext Property
- Err.HelpFile Property
- Err.LastDLLError Property
- Err.Number Property
- Err.Raise Method
- Err.Source Property
- Error, Error$ Functions
- Error Statement
- Event Statement
- Exit Statement
- Exp Function
- File Object (VB6)
- File.Copy Method (VB6)
- File.Delete Method (VB6)
- File.Move Method (VB6)
- File.OpenAsTextStream Method (VB6)
- File System Object Model (VB6)
- FileAttr Function
- FileCopy Statement
- FileDateTime Function
- FileLen Function
- Files Collection Object (VB6)
- FileSystemObject Object (VB6)
- FileSystemObject.BuildPath Method (VB6)
- FileSystemObject.CopyFile Method (VB6)
- FileSystemObject.CopyFolder Method (VB6)
- FileSystemObject.CreateFolder Method (VB6)
- FileSystemObject.CreateTextFile Method (VB6)
- FileSystemObject.DeleteFile Method (VB6)
- FileSystemObject.DeleteFolder Method (VB6)
- FileSystemObject.DriveExists Method (VB6)
- FileSystemObject.Drives Property (VB6)
- FileSystemObject.FileExists Method (VB6)
- FileSystemObject.FolderExists Method (VB6)
- FileSystemObject.GetAbsolutePathName Method (VB6)
- FileSystemObject.GetBaseName Method (VB6)
- FileSystemObject.GetDrive Method (VB6)
- FileSystemObject.GetDriveName Method (VB6)
- FileSystemObject.GetExtensionName Method (VB6)
- FileSystemObject.GetFile Method (VB6)
- FileSystemObject.GetFileName Method (VB6)
- FileSystemObject.GetFolder Method (VB6)
- FileSystemObject.GetParentFolderName Method (VB6)
- FileSystemObject.GetSpecialFolder Method (VB6)
- FileSystemObject.GetTempName Method (VB6)
- FileSystemObject.MoveFile Method (VB6)
- FileSystemObject.MoveFolder Method (VB6)
- FileSystemObject.OpenTextFile Method (VB6)
- Filter Function (VB6)
- Fix Function
- Folder Object (VB6)
- Folder.Copy Method (VB6)
- Folder.CreateTextFile Method (VB6)
- Folder.Delete Method (VB6)
- Folder.Move Method (VB6)
- Folders Collection Object (VB6)
- Folders.Add Method (VB6)
- For...Next Statement
- For Each...Next Statement
- Format, Format$ Functions
- FormatCurrency, FormatNumber, FormatPercent Functions (VB6)
- FormatDateTime Function (VB6)
- FreeFile Function
- Function Statement
- FV Function
- Get Statement
- GetAllSettings Function
- GetAttr Function
- GetAutoServerSettings Function
- GetObject Function
- GetSetting Function
- GoSub...Return Statement
- Goto Statement
- Hex, Hex$ Functions
- Hour Function
- If...Then...Else Statement
- IIf Function
- IMEStatus Function
- Implements Statement
- Initialize Event
- Input, Input$, InputB, InputB$ Functions
- Input # Statement
- InputBox Function
- Instancing Property (VB only)
- InStr, InStrB Functions
- InstrRev Function (VB6)
- Int Function
- IPmt Function
- IRR Function
- IsArray Function
- IsDate Function
- IsEmpty Function
- IsError Function
- IsMissing Function
- IsNull Function
- IsNumeric Function
- IsObject Function
- Join Function (VB6)
- Kill Statement
- LBound Function
- LCase, LCase$ Functions
- Left, Left$, LeftB, LeftB$ Functions
- Len, LenB Functions
- Like Operator
- Line Input# Statement
- Load Statement
- LoadResData Function
- LoadResPicture Function
- LoadResString Function
- Loc Function
- Lock Statement
- LOF Function
- Log Function
- LSet Statement
- LTrim, LTrim$ Functions
- Me Operator
- Mid, Mid$, MidB, MidB$ Functions
- Mid, MidB Statements
- Minute Function
- MIRR Function
- MkDir Statement
- Month Function
- MonthName Function (VB6)
- MsgBox Function
- MTSTransactionMode Property (VB6 only)
- Name Property
- Name Statement
- Now Function
- NPer Function
- NPV Function
- Oct, Oct$ Functions
- On Error Statement
- Open Statement
- Option Base Statement
- Option Compare Statement
- Option Explicit Statement
- Option Private Module Statement
- Persistable Property (VB6 Only)
- Pmt Function
- PPmt Function
- Print # Statement
- Printer Object and Printers Collection
- Private Statement
- Property Get Statement
- Property Let Statement
- Property Set Statement
- Public Statement
- Put Statement
- PV Function
- QBColor Function
- RaiseEvent Statement
- Randomize Statement
- Rate Function
- ReDim Statement
- Rem Statement
- Replace Function (VB6)
- Reset Statement
- Resume Statement
- Return Statement
- RGB Function
- Right, Right$, RightB, RightB$ Functions
- RmDir Statement
- Rnd Function
- Round Function
- RSet Statement
- RTrim, RTrim$ Functions
- SaveSetting Statement
- Second Function
- Seek Function
- Seek Statement
- Select Case Statement
- SendKeys Statement
- Set Statement
- SetAttr Statement
- Sgn Function
- Shell Function
- Sin Function
- SLN Function
- Space, Space$ Functions
- Spc Function
- Split Function (VB6)
- Sqr Function
- Static Statement
- stdDataFormat Object (VB6)
- stdDataFormats Object (VB6)
- Stop Statement
- Str, Str$ Functions
- StrComp Function
- StrConv Function
- String, String$ Functions
- StrReverse Function (VB6)
- Sub Statement
- Switch Function
- SYD Function
- Tab Function
- Tan Function
- Terminate Event
- TextStream Object
- TextStream.Close Method
- TextStream.Read Method
- TextStream.ReadAll Method
- TextStream.ReadLine Method
- TextStream.Skip Method
- TextStream.SkipLine Method
- TextStream.Write Method
- TextStream.WriteBlankLines Method
- TextStream.WriteLine Method
- Time, Time$ Functions
- Time Statement
- Timer Function
- TimeSerial Function
- TimeValue Function
- Trim, Trim$ Functions
- Type Statement
- TypeName Function
- UBound Function
- UCase, UCase$ Functions
- Unload Statement
- Unlock Statement
- Val Function
- VarType Function
- Weekday Function
- WeekdayName Function (VB6)
- While...Wend Statement
- Width Statement
- With Statement
- WithEvents Keyword
- Write # Statement
- Year Function
- Part III
- Language Elements by Category
- Collection Object
- Conditional Compilation
- Data Type Conversion Functions
- Data Bindings Objects (VB6 only)
- BindingCollection Object
- Binding Object
- Date and Time Functions
- Dictionary Object (VB6 Only)
- Err Object
- FileSystem Objects (VB6 only)
- FileSystemObject Object
- Drives Collection Object
- Drive Object
- Folders Collection Object
- Folder Object
- Files Collection Object
- File Object
- TextStreamObject
- File and Folder Handling
- Financial Functions
- Formatting Functions
- Information Functions
- Interaction Functions
- Math Functions
- Programming and ActiveX Programming
- Printer Object
- Program Structure and Flow
- Registry Functions
- String Manipulation
- Variable Declaration
- Language Constants
- Application Window Style (VbAppWinStyle)
- Calendar (VbCalendar)
- Call Type (VB6 only)
- Compare Method (VbCompareMethod)
- Data Binding Update Mode (VB6 Only)
- Date Time Format Styles (VB6 Only)
- Day of Week (VbDayOfWeek)
- Drive Type (VB6 only)
- File Attributes (VbFileAttribute)
- File System Objects File Attributes (VB6 Only)
- First Week of Year (VbFirstWeekOfYear)
- IME Status (VbIMEStatus)
- Language Constants
- Log Event Type Style (LogEventTypeConstants)
- Log Mode Constants (VB6 only)
- Message Box Result (VbMsgBoxResult)
- Message Box Style (VbMsgBoxStyle)
- Special Folder Types (VB6 only)
- String Conversion (VbStrConv)
- TextStream IOMode (VB6 only)
- Tristate Constants (VB6 Only)
- Variant Type (VbVarType)
- Operators
- Arithmetic Operators
- String Operator
- Comparison Operators
- The Is Operator
- Logical and Bitwise Operators
- Operator Precedence
- What's New in VB6?
- Create DataSource and Data Consumer Classes
- Functions Can Return Arrays
- Dynamic Arrays Can Be Assigned
- Remote User-Defined Types
- New Functions
- Enhanced CreateObject Function
- New Object Models
- Index
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.