Using Logicim XLGL in a VBA macro
In visual basic for applications (VBA), you can call any Logicim XLGL worksheet function and a number of useful Logicim XLGL macros by using the Application.Run
Excel command.
For example, you can get the balance of account 4010 using the Logicim XGL worksheet function:
Dim balance as Double balance = Application.Run("XGL", "4010")
Ensure to supply all parameters in the order specified in the documentation of each function. Empty arguments can be an empty string. For example, to get the total amount of all transactions in account 4010-0300, where 0300 is the department, you would use:
Dim amount as Double amount = Application.Run("XGLP", "4010", "", "", "0300")
Predefined macros
Utilize the following commands to achieve actions normally done using the Logicim XLGL Ribbon:
- Open the connection panel (to actually open a connection, use the XConnect worksheet function)
Application.Run "XLGL.Connect"
- Open the report panel
Application.Run "XLGL.Reports"
- Refresh the workbook
Application.Run "XLGL.Refresh"
- Recalculate the workbook
Application.Run "XLGL.Recalculate"
- Freeze the active workbook
Application.Run "XLGL.Freeze"
- To prevent a confirmation message from being displayed, use
Application.Run "XLGL.Freeze", False
- Freeze the active worksheet
Application.Run "XLGL.FreezeWorksheet"
- To prevent a confirmation message from being displayed, use
Application.Run "XLGL.FreezeWorksheet", False
- Freeze the selected cell range
Application.Run "XLGL.FreezeRange"
- To prevent a confirmation message from being displayed, use
Application.Run "XLGL.FreezeRange", False
- Open the drill-down window for the selected range
Application.Run "XLGL.Drilldown"
- Hide rows and columns containing only zeros
Application.Run "XLGL.HideZeros"
- Hide rows containing only zeros
Application.Run "XLGL.HideZeroRows"
- Hide columns containing only zeros
Application.Run "XLGL.HideZeroColumns"
- Unhide rows and columns
Application.Run "XLGL.Unhide"
- Unhide rows
Application.Run "XLGL.UnhideRows"
- Unhide columns
Application.Run "XLGL.UnhideColumns"
- Prepare print layout for active worksheet
Application.Run "XLGL.PrintLayout"
- Create a copy of the active worksheet
Application.Run "CopyCurrentWorksheet"
- Switch language
Application.Run "XLGL.SwitchLanguage"
Edited: Tuesday, November 05, 2024
Was this article helpful?
Thank you! Your feedback matters.
Related articles
No related articles found
You can Contact us so we can address your question.