FeResPost Web Site                     FeResPost Online User Manual

VI.0.1.4 Accessing the COM component in VBA

When programming in VBA, for example in excel, the component must first be referenced in the excel workbook. For this:

1.

Open the VBA editor from an excel workbook.

2.

Go to the “Tools” menu and select the “References” menu.

3.

There, you select the (or one of the) available FeResPost library. For example, for version 3.1.7, the library is referred to as “FeResPost 3.1.7 COM server”.

4.

Quit the “Tools/References” menu.

5.

Then, the server can be accessed from excel VBA code with a statement like:

              set frpApp= CreateObject("FeResPost_3_1_7.Application")

Once the FeResPost component library is activated, the different classes and the corresponding methods can be viewed in the object explorer. During the VBA program execution, the behavior of the different classes and methods can also be watched.

If you want to change the version of VBA used in an existing excel VBA project, proceed as follows:

1.

It may be practical to un-activate the execution of excel VBA macros before doing the following operations.

2.

Make sure that the new version of FeResPost is properly registered.

3.

Open the VBA editor from an excel workbook.

4.

Go to the “Tools” menu and select the “References” menu.

5.

Un-select the old version of FeResPost COM server. (The one you no longer want to use.)

6.

Quit the “Tools/References” menu.

7.

Re-enter into the “Tools” menu and select the “References” menu.

8.

Select the new version of FeResPost COM server you want to use in the workbook.

9.

Quit the “Tools/References” menu.

10.

Do not forget to modify the version of the server requested by “CreateObject” method in excel VBA code.

If you no longer need the old version of FeResPost COM server, you can un-register it and delete the corresponding files from your computer.