Treball amb les macros VBA

Visual Basic for Applications (VBA) is an implementation of Microsoft's Visual Basic which is built into all Microsoft Office applications.

La compatibilitat amb el VBA no és total, però admet una gran part dels patrons d'ús comú. La majoria de les macros utilitzen un subconjunt manejable d'objectes de l'API de l'Excel (com ara Range, Worksheet i Workbook, etc.); la compatibilitat amb el VBA inclou aquests objectes i llurs mètodes i propietats més populars.

Càrrega de documents del Microsoft Office amb macros VBA executables

Choose - Load/Save - VBA Properties and mark the Executable code checkbox. Then load or open your document.

Codi executable

El codi VBA es carregarà a punt per executar-se. Si no activeu aquesta casella de selecció, el codi es marcarà com a comentari per poder-lo revisar, però no s'executarà.

Icona de consell

After loading the VBA code, LibreOffice inserts the statement Option VBASupport 1 in every Basic module to enable a limited support for VBA statements, functions and objects. See Option VBASupport Statement for more information.


Execució de macros VBA

Run VBA macros in the same way as LibreOffice Basic macros.

Icona d'avís

Since support for VBA is not complete, you may have to edit the VBA code and complete the missing support with LibreOffice Basic objects, statements and functions.


Edició de macros VBA

És possible modificar les macros escrites en VBA amb l'EID del Basic del LibreOffice.