rtslink.com
Home / UDI-Magic / Standard / VBA

Using VBA with UDI-Magic



Introduction to VBA


VBA is an implementation of Microsoft's Visual Basic, an event driven programming language which is built into most of the Microsoft Office Applications. It can be used to control all aspects of the host application (herein MS-Excel). VBA as it's name suggests, is closely related to Visual Basic.

You can use VBA to manipulate your Excel data like :-
a) Performing calculations
b) Adding new rows/columns with data
c) Deleting rows/columns
d) Almost any other task that can be done in MS-Excel manually


Loading Macro File


To use VBA with udiMagic, you must specify the file that contains the VBA code (macros). Here's sample XML tag to load a file named Macro1.txt.

<VBA LOADFILE="Macro1.txt" RUNMACROATSTARTUP="TEST"/>


Remarks:-
1) The above XML tag loads the Macro1.txt file and runs the macro named TEST on startup. 
    (i.e. when the Excel file is loaded into memory by udi-Magic).
2) The attribute RUNMACROATSTARTUP is used to specify the macro which you need to run at startup. 
    Using RUNMACROATSTARTUP attribute is optional.


Invoking Macro's


UDI-Magic allows you can invoke Macro's (VBA code) at run-time. Here's a sample XML tag to invoke a macro name "MyCalculations".

<MyTag  RUNVBAMACRO="MyCalculations"/>

Remarks:-
You can use the attribute RUNVBAMACRO with any of your XML tags. RUNVBAMACRO invokes the specified macro.




Tags: Excel to Tally,VBA
Tally is a registered trademark of Tally Solutions FZ LLC.

Valid HTML 4.01 Transitional