Code - VB6 / VBA (Visual Basic / Visual Basic for Applications)

Create better VBA code faster. For Microsoft(r) Access, Microsoft(r) Excel, Microsoft(r)Word, Microsoft(r) Outlook and other Microsoft  Office apps.  Price: USD149

With Code-VBA coding tools added to your Visual Basic development environment you create better VBA code faster. A set of 17 specialized code builders supports the fast creation of most used code.

Please see also the HTML Help Generator which creates context sensitive HTML Help integrated with your Visual Basic 6, VS.NET or Microsoft Access applications in seconds.

Order

Platform : Windows XP/2000/2003/Me/NT/98

Requires Microsoft Office 97 or later

Additional Information: Code - VB/VBA
Code - VB6

Buy Online

$149.00

bbuy.gif (1156 bytes)

Code - VBA

Buy Online

$149.00

  bbuy.gif (1156 bytes)


  Additional Code - VB/VBA Information

Builders included in Code-VB / Code-VBA

Below you will find short descriptions of all builders. Each builder description starts with the name on which you can click to move to the full description.

  1. Code Line builder
  2. Fragment builder
  3. Fragment editor
  4. Procedure builder
  5. Class builder
  6. Property builder
  7. Variable builder
  8. Constant builder
  9. Argument builder
  10. Enumerated constant builder
  11. Select Case from Enum builder

Line of Code Builder

Coding using Line of code builder consists of selecting the appropriate procedure and moving thru the open (variable or argument) positions using tab. At each insertion point a pop-up lets you select an appropriate action: insert an existing or new variable or insert an expression. Lines of code builder supports both built-in and your custom code fragments. It adds the ability to activate VB language help on a selected built-in procedure which is useful if you are not certain which procedure should be used. Also you can set a checkbox so that the procedure's arguments are added explicit (e.g. Interval:="d").

Change default behavior in Settings dialog.

Start this dialog from Toolbar or using Alt-CL (Code-vb - Line of code)

In the left list box also modules appear which you added to your \library folder

Controls:


Groups

(First list box) Shows which libraries or modules the procedure is derived from.

Procedures

(Second list box) Shows which procedures are available in the selected group

Procedure Line

(textbox showing the line for the selected procedure)

?

Starts Visual Basic help on the selected procedure.

Add Comment

Adds a line of comment to explain what the procedure does. Not available in this version

Explicit arguments

If this is checked

Each argument on a new line

Determines if all arguments in a procedure are placed on the same line ...

MySub Arg1, Arg2, ...
... or each on a new line
 
MySub Arg1, _
                Arg2, _
                 ...

 

Call Function as Sub

(Applies only to functions) Replaces normal behavior

ret = MyFunction()
by
MyFunction

 

Insert

Inserts the line of code at the cursor position and closes the dialog.

Cancel

Closes the dialog without insertingt the line of code .

Help

Starts this Help topic

Top

Fragment Builder

Fragments are pieces of code that occur regularly in programs but which can't be encapsulated in procedures. The image shows a typical example of a fragment (Open Jet Database). It consists of a series of lines you use regularly in your code, but which you would normally not encapsulate in a procedure.

Start this dialog from Toolbar or using Alt-CN (Code-vb - Fragment)

Coding using fragment builder consists of selecting the appropriate fragment and moving thru the open parameter positions using tab. At each positions a pop-up lets you select an appropriate action: insert an existing or new variable or expression. A selected variable will automatically replace all parameter positions with the same specification (see below). [Insert] adds the fragment to the current position in the code module. The cursor is automatically moved to the position in the fragment marked with <cursor>.

A selected variable will automatically replace all parameter positions with the same specification

 

Controls:


Fragments organized in folders

The fragments are stored physically as .bas files in folders. The location of this folder can be found from Settings. You can add your own subfolders using Windows Explorer. Only those folders are visible which contain code that uses libraries that are referenced. E.g. Access does not show (content of) Excel folder, unless there is a reference to Excel. If Access has a reference to DAO , DAO fragments are shown and not ADO (unless that was also referenced). This is managed in a file called cvbrefra.ini, located next to the add-in dll file.

List of fragments

Shows the fragments for the folder which is currently selected AND that of all subfolders EXCEPT folders which require a reference.

Selected fragment

Shows fragment and applied variable substitutions.

Splitter

Use selected fragment

Insert

Inserts the fragment to the current position in the code module. The cursor is automatically moved to the position in the fragment marked with <cursor>. Uses defaults on not specified parameters.

Cancel

Closes the builder without adding the fragment

Help

Starts this Help topic

Fragments management

New

Create a new fragment.

Edit

Edit selected fragment.

Delete

Delete selected fragment.

Top

Fragment Editor

Currently we are significantly expanding the fragments collection. You can also define your own fragments with the fragment editor. A fragment looks like a piece of code, but the variables are replaced by markers withparameter specification that looks like:

 {Type:Name:DefaultValue}. Name and DefaultValue are optional.

These markers can easily created by double-clicking on the appropriate one in the list box on the right. Most common is using {VARIABLE} or {VARIABLE:NAMED}. Other markers like {AUTHOR} or {DATE} obtain their values from either the Settings or a built-in function.

Position markers like <end_of_top> and <begin_of_bottom> can be used to distribute code in one fragment over different parts in a procedure: as part of the declaration section, at the end of a procedure (close actions). <cursor> is used to indicate where the cursor is to be after the fragment has been inserted.

Start this dialog from Fragment Builder, [New] button.

Controls:


Fragment content

Contains the fragment's code.

List of markers

Available markers in the list box on the right. These markers can easily be used by double-clicking on them. Most common is using {VARIABLE} or {VARIABLE:NAMED}. Other markers like {AUTHOR} or {DATE} obtain their values from either the Settings or a built-in function.

Save As

Opens dialog to specify in which subfolder the fragment is to be placed.

Cancel

Closes the builder without creating the fragment.

Help

Starts this Help topic

Insert

Adds selected marker to fragment content

Splitter

Resize  fragment content area.

Top

Procedure Builder

Start this dialog from Toolbar or using Alt-CR (Code-vb - Procedure)

Controls:

Static

If selected all variables in the procedure will keep their value between calls.

Accessibility

Select if a variable is to be Public or Private or procedure or module level or part of the interface.

Type

Sub or Function (returns value).

Name

Name of the procedure.

Arguments

Arguments of the procedure.

+

Add argument

-

Remove selected argument.

?

Move selected argument one position up

 

?

Move selected argument one position down.

Return Value Type

Type of the value that is returned in case of a a function.

Description

For those professional developers who take documenting code seriously :). The description is added below the procedure interface it is part of , e.g.

Sub ProcessFile(sFile as String)
' File to be processed

 

Options


Procedures contain quite a lot of repetitive statement. This group box let's you determine in each case you are adding  a procedure which lines to include and which not.

Add Return Statement

In case it is a function there will at least be one statement determining the value to be returned. Check this and such a statement gets inserted:

Function MyFunction() As String
    MyFunction =
End Function

 

Header

Whether to include procedure header text or not.
You have to determine in each case if you want this additional text.

Function MyFunction() As String
    MyFunction =
End Function

 

Hourglass

If the process involved with the property is lengthy, it makes sense to add Hourglass.

Arguments on Separate Line

Determines if all arguments are placed on the same line ...

Sub MySub (Arg1, Arg2, ...)
... or each on a new line
 
Sub MySub (Arg1, _
                Arg2, _
                 ...)

Procedure Constant

If checked insert procedure constant at top of procedure of not yet present.

Const cstrProcedure = "MyProcedure"

 

Module Constant

If checked insert module constant at top of module of not yet present.

Private Const cstrModule As String = "ThisWorkbook"

Add Error Handler

Select what error handling, if any, you want added from the combo box.
The default is set in Settings.

Module

If you use global constants (accessibility) and keep them in an other then the current module. You can select this module here, which saves you a trip to the other module and back.

OK

Create the procedure.

Cancel

Closes the builder without creating the constant .

Help

Starts this Help topic

Top

Class Builder

Classes are the most important means for structuring your applications. This class builder helps you define classes efficiently. Use the class builder to create a class with corresponding properties and methods. Check the Collection Class to have that created too.

Start this dialog from Toolbar or using Alt-CA (Code-vb - class)

Controls:


Class Name

Name of the class to be created.

Description

Description to be added to the top of the class module

Collection Class

The collection class features support for enumeration (For Each) and Clear method.

Also make Collection Class

Check this if you want the collection class created

Collection Class Name

Name of the collection class

Properties



Define the properties of the class.

New

Opens the Property Builder

Change

Select the property in the list. Pressing [Change] opens the Property Builder

Delete

Select the property in the list. Pressing [Delete] removes the property.

Methods



Define the methods of the class.

New

Opens Method Builder

Change

Select the method in the list. Pressing [Change] opens Method Builder

Delete

Select the method in the list. Pressing [Delete] removes the method.

OK

Create class and optionally collection class and close dialog.

Cancel

Close dialog without cCreate a class.

Help

Starts this Help topic.

Top

Property Builder

Adding Property procedures as part of programming classes is time consuming. A typical piece of code looks like this:

Private msColorText As String
Public Property Get ColorText() As String
  ColorText = msColorText
End Property
Public Property Let ColorText(rData As String)
  msColorText = rData
End Property

The Property Builder creates this code and more, depending on the extra options you selected.

Start this dialog from Toolbar or using Alt-CPA (Code-vb - Property - Add)

Alternative: use fast declaration if you only need simple procedure level variables thru menu: Property > {property  type}

Controls:

Accessibility

Select if a variable is to be Public or Private.

Static

If selected all variables in the procedure will keep their value between calls.

Property

 
Check which procedure you want: Get, Let/Set or both. The builder decides itself if it needs to use Set (with objects) or Let.

Get

Return the value of the property

Let/Set

Set the value of the property.

Name

Name of the Property. Don't use prefix in the name.

Type

Type of the property.

Description

For those professional developers who take documenting code seriously :). The description is added after the declaration.

Options

 
You can determine what is the default behavior on the Settings dialog

Header

Whether to include procedure header text or not.
You have to determine in each case if you want this additional text.

Hourglass

If the process involved with the property is lengthy, it makes sense to add Hourglass.

Procedure Constant

If checked insert procedure constant at top of procedure of not yet present.

Const cstrProcedure = "MyProcedure"

Module Constant

If checked insert module constant at top of module of not yet present.

Private Const cstrModule As String = "ThisWorkbook"

Add Error Handler

Select what error handling, if any, you want added from the combo box.
The default is set in Settings.

Module

If you use global variables (accessibility) and keep them in an other then the current module. You can select this module here, which saves you a trip to the other module and back.

OK

Create the property.

OK New

Useful extra button when you are declaring a bunch of propertys at the same time

Cancel

Help

Starts this Help topic.

Top

Variable Builder

Declares variables without moving from the current position. The variable is added at the top of the procedure, in the procedure's interface or in a selected module. A copy can be pasted at the current position using ctrl-v, the place where you actually use it. The builder saves time by:

  1. not having to move to the declaration section and back
  2. copying the variable so it is available thru clipboard (ctrl-v)
  3. automatically selecting type based on used prefix in name.
  4. pick up name from selected text
  5. inserts standard statements for object variables.

Start this dialog from Toolbar or using Alt-CVA (Code-vb - Variable - Add)

The name is kept on the clipboard and can be inserted directly at the position you are working using Ctrl-V.

Alternative: use fast declaration if you only need simple procedure level variables thru menu: Variable > {variable type}

Controls:

Accessibility

Select if a variable is to be Public or Private or procedure or module level or part of the interface.

Name

If you use prefix (lowercase) the builder will automatically try to interpret type, level and, if it is in the interface, ByRef/ByVal. Prefixing behavior can be changed in the Settings dialog.

Type

Select the type of the variable. While entering characters the type gets selected incrementally. Selecting type may change prefix. Prefixing behavior is defined in the Settings dialog.

Length

Only in case of strings, let's you specify the length of the string

Is Array and Array Dimensions

Enter array dimensions the normal way, e.g.

1 To 3, 1 To MAXCOLS

Description

For those professional developers who take documenting code seriously :). The description is added after the declaration, e.g.

Dim sFile as String ' File to be processed

or below the procedure interface if it is part of that, e.g.

Sub ProcessFile(sFile as String)
' File to be processed

 

Interface

Set these to define how and where a variable is to be defined as a procedures argument. To indicate it is to be a procedures argument you have to set Accessibility to 'Interface'

ByVal

ByVal allows the procedure to access a copy of the variable. As a result, the variable's actual value can't be changed by the procedure to which it is passed. As opposed to ByRef in which the variable is shared between the calling and called procedures.

ParamArray

Used only as the last argument in arglist to indicate that the final argument is an Optional array of Variant elements. The ParamArray keyword allows you to provide an arbitrary number of arguments. ParamArray can't be used with ByVal, ByRef, or Optional.

Optional

Optional indicates that an argument is not required when calling the procedure.

Default

Any constant or constant expression to be used when the procedure is called without specifying the Optional argument. If the type is an Object, an explicit default value can only be Nothing.

Before Argument

By selecting one of the existing arguments you can explicitly set where the variable is to be added in the procedure's interface. If nothing is selected it is put as last.

Object


By checking all options you can have all these statements inserted in one go (example inserting rng as Range variable):

Dim rng As Range
Range
With rng

End With



 

 

Set = New

Create an instance of the object.

With ...

Efficient way to call a series of properties and methods, e.g.

With rng
    .Font.Bold = True
    .Select
End With
 

 

Set = Nothing

Explicitly free memory and system resources used by objects. 

Module



If you use global variables (accessibility) and keep them in an other then the current module. You can select this module here, which saves you a trip to the other module and back.

 

OK

Create the variable.

OK & New

Useful extra button when you are declaring a bunch of variables at the same time.

Cancel

Closes the builder without creating the variable

Help



Starts this Help topic

Top

Argument Builder

Used to specify the arguments from Procedure Builder.

Start this dialog from the Procedure Builder.

Controls:


Optional

Optional. Indicates that an argument is not required. If used, all subsequent arguments in arglist must also be optional and declared using the Optional keyword. Optional can't be used for any argument if ParamArray is used.

ByVal / ByRef


Choose the way of passing the value.

ByVal

A way of passing the value of an argument to a procedure instead of passing the address. This allows the procedure to access a copy of the variable. As a result, the variable's actual value can't be changed by the procedure to which it is passed.

ByRef

A way of passing the address of an argument to a procedure instead of passing the value. This allows the procedure to access the actual variable. As a result, the variable's actual value can be changed by the procedure to which it is passed. Unless otherwise specified, arguments are passed by reference.

ParamArray

Used only as the last argument in arglist to indicate that the final argument is an Optional array of Variant elements. The ParamArray keyword allows you to provide an arbitrary number of arguments. It may not be used with ByVal, ByRef, or Optional.

Name

Name of the argument

Data Type

Type of the argument

Array

Check this if the argument is to be an array.

Default Value

Specify value to be used if argument is optional and no value was specified during call.

OK

Adds the argument to the procedure and closes dialog.

OK & New

Adds argument to procedure without closing dialog. Enables you to add several arguments fast.

Cancel

Closes dialog without adding an argument to the procedure.

Help

Starts this Help topic

Constant Builder

Declares constants without moving from the current position. The constant is added at the top of the procedure or in the declaration section of a selected module. A copy can be pasted at the current position using ctrl-v, the place where you actually use it. The builder saves time by:

  1. not having to move to the declaration section and back
  2. copying the constant so it is available thru clipboard (ctrl-v)
  3. automatically selecting type based on used prefix in name.
  4. pick up name from selected text
  5. replaces selected text by name as used in builder

Example: If in module selected text is:

Resource Management

then in the Constant Builder it would be picked up as

csRESOURCEMANAGEMENT (and value 'Resource Management')

After OK the following insertion takes place

Const csRESOURCEMANAGEMENT As String = "Resource Management"
 
csRESOURCEMANAGEMENT
 
Note: the exact behavior can be changed in Settings

Start this dialog from Toolbar or using Alt-CCA (Code-vb - Constant - Add)

Alternative: use fast declaration if you only need simple procedure level constants thru menu: Constant > {constant type}

Controls:

Accessibility

Select if a constant is to be Public or Private or procedure or module level.

Name

If you use prefix (lowercase) the builder will automatically try to interpret type and level. Prefixing behavior can be changed in the Settings dialog. Here you can also set if the constant name should always be uppercase.

DataType

Select the type of the constant. While entering characters the type gets selected incrementally. Selecting type may change prefix. Prefixing behavior is defined in the Settings dialog.

Value

If you pre-selected text in the module, both the name and the value field get that text as initial value.
This is useful if you want to move strings out of the code to constants for code refactoring. E.g.

strProfile = "Mark"

would then become

Const strMARK = "Mark"
strProfile = strMARK

or something close to this, you can alter the defaults to your liking, but this default behavior is likely to save you some typing effort.

 

Description

For those professional developers who take documenting code seriously :). The description is added after the declaration, e.g.

Dim sFile as String ' File to be processed

 

Module

If you use global constants (accessibility) and keep them in an other then the current module. You can select this module here, which saves you a trip to the other module and back.

OK

Create the constant.

OK New

Useful extra button when you are declaring a bunch of constants at the same time.

Cancel

Closes the builder without creating the constant .

Top

Enum Builder

Visual Basic is full of enumerated constants (types) that make programming easier; the meaning of MsgBox value 4 is obscure but the meaning of the value vbYesNo is obvious. Summing up all possible types, states, roles or whatever entities you're dealing with will help you ascertain that you don't forget some cases, causing bugs in the program. By specifying your own enumerated constants for values used within your own organization you make your own code more reliable and easier to maintain.

By default, enumerated constants hold a series of consecutive longs starting from zero. This example assigns values 0 to 3 to four security levels:

Public Enum sleSecLevels
  sleAdmin
  slePowerUser
  sleUser
  sleGuest
End Enum

The security routines in the rest of the application can now refer to sleAdmin and the other constants instead of their numeric values. The three-letter lower case prefix helps you recognize the constant as part of this enumerated set when you see it in code.

Working with enumerated constants is encouraged by the Select Case from Enum Builder.

You can add a constant to the enumerated type without having to move to the location where it is declared using  Add Constant To Enum

Start this dialog from using Alt-CCE (Code-vb - Constant - new Enum)

Controls:

Prefix

What is specified here is automatically added to both the enumerated type and the individual constants. In the example: sle

Name

Name of the Enumerated Type

Items

Add the constants to be included in this textbox. Each constant on a separate line. The following variants are allowed:

1. Without starting point, as above example. First value is 0

2. With starting point, each entry has integer value one higher then the previous item

mcColorBlue = 37
mcColorRed
mcColorGreen

3. Each a separate constant

mcColorBlue = 37
mcColorRed = 44
mcColorGreen = 135

 

Module

Module in which the constant is to be placed (only in case of Public accessibility).

OK

Create enumerated type and close dialog.

Cancel

Close dialog without creating enumerated type.

Help

Starts this Help topic

Accessibility



Determines from which modules in the application the enumerated type is visible.

Private

The enumerated type is visible only from the current module.

Public

The enumerated type is visible only from all modules.

Default

(= public) The enumerated type does not have explicit accessibility.

Top

Select Case from Enum Builder

Select Case from Enum Builder creates a 'Select Case' statement from enumerated constants.

The simplest variant (all checkboxes false results, example enum is MailFormat) in

Select Case
Case mfHTML

Case mfPlainText

Case mfRTF

End Select
 
Select Case
Case mfHTML, mfPlainText, mfRTF

End Select
Select Case
Case mfHTML
    MyFunction = "HTML"
Case mfPlainText
    MyFunction = "PlainText"
Case mfRTF
    MyFunction = "RTF"
End Select
(Very useful for getting a text representation of the Enum fast)

 'Compact' makes the code use less space:

Select Case
Case mfHTML: MyFunction  = "HTML"
Case mfPlainText: MyFunction  = "PlainText"
Case mfRTF: MyFunction  = "RTF"
End Select
 
Finally, Add Case Else determines if a 'Else' case is added. The textbox Case Else contains what line of code will be added in this case.

Controls:

Listbox

Shows all enumerated types, built-in and custom made.

Test expression

Select a variable or function to play the role of the expression to be evaluated in the Select Case statement.

OK

Inserts the Select Case statement and closes the dialog.

Cancel

Closes the dialog without inserting the Select Case statement..

Help

Start this Help topic.

VBA Programming Additional Features

Additional support for Microsoft Access and Microsoft Excel

Code-VB supports Access:

 

 

 

 

 

 

A collection of 200+ typical VBA code fragments (Microsoft(r) Excel, Microsoft(r) Access, DAO, ADO, ...)

for use with Fragments Builder

System Requirements

Platform : Windows XP/2000/2003/Me/NT/98

Requires Microsoft Office 97 or later

Order

Additional Information: Code - VB/VBA
Code - VB6

Buy Online

$149.00

bbuy.gif (1156 bytes)

Code - VBA

Buy Online

$149.00

  bbuy.gif (1156 bytes)


HTML Help Generator 

Solid HTML Help integrated with your application in no time

Creates context sensitive HTML Help integrated with your Visual Basic 6, VS.NET or Microsoft Access applications in seconds.

HTML Help generators (add-ins) let you add high quality context-sensitive help to your application in virtually seconds. Use the HTML Help generator wizard and generate the HTML Help. Run your program, press F1 for help and there it is, HTML help on your current form, perfectly presented. Magic! In addition you can export the HTML Help project to Word to use it as user or technical documentation.

VB HTML Help generator

 

What's the secret?

The principle is simple. The generator scans your application and

  1. creates HTML files and screenshots for each topic in your help system,
  2. sets the HelpContextId property for each processed form,
  3. creates the necessary project files (including table of contents and index),
  4. links the help file to your application.

Each form in your application is analyzed in detail in terms of controls, menu, tab order etcetera and presented as a perfectly organized HTML page. After the HTML files have been generated you can use your favorite HTML editor to add the explanatory text and make the additional pages you require. The general high quality framework has already been set up for you. By the way, one of the great things with HTML help is that you can publish the result to your website too. The Help compiler (HHC) in MS HTML Help Workshop (HHW) is used to create the Help file.

The image above shows a separate page created for each form. Each form page starts with a Jpeg screenshot. Controls on the images are linked to their description. Above the individual form pages are the Welcome page and Dialogs page (listing all forms). Sample pages (getting started, registration and support) are added to the help, depending on the answers you supplied to the wizard.

Platform : Windows XP/2000/2003/Me/NT/98

Requires Microsoft Office 97 or later if you want use this product with MS Access

Order

Goto Developer Web Site for more information

Additional Information: HTML Help Generator
VB HTML Help Generator

Buy Online

$99.00

bbuy.gif (1156 bytes)

MS Access HTML Help Generator

Buy Online

$99.00

  bbuy.gif (1156 bytes)

HTML Help Generator for VS.NET 2003

Buy Online

$99.00

  bbuy.gif (1156 bytes)


More Source Code Software 

Home

  More Software     More Car Software   Excel Spreadsheets