Using Logicim XLGL in a VBA macro

Visual Basic for Applications VBA

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:

  1. Open the connection panel (to actually open a connection, use the XConnect worksheet function)
Application.Run "XLGL.Connect"
  1. Open the report panel
Application.Run "XLGL.Reports"
  1. Refresh the workbook
Application.Run "XLGL.Refresh"
  1. Recalculate the workbook
Application.Run "XLGL.Recalculate"
  1. Freeze the active workbook
Application.Run "XLGL.Freeze"
  1. To prevent a confirmation message from being displayed, use
Application.Run "XLGL.Freeze", False
  1. Freeze the active worksheet
Application.Run "XLGL.FreezeWorksheet"
  1. To prevent a confirmation message from being displayed, use
Application.Run "XLGL.FreezeWorksheet", False
  1. Freeze the selected cell range
Application.Run "XLGL.FreezeRange"
  1. To prevent a confirmation message from being displayed, use
Application.Run "XLGL.FreezeRange", False
  1. Open the drill-down window for the selected range
Application.Run "XLGL.Drilldown"
  1. Hide rows and columns containing only zeros
Application.Run "XLGL.HideZeros"
  1. Hide rows containing only zeros
Application.Run "XLGL.HideZeroRows"
  1. Hide columns containing only zeros
Application.Run "XLGL.HideZeroColumns"
  1. Unhide rows and columns
Application.Run "XLGL.Unhide"
  1. Unhide rows
Application.Run "XLGL.UnhideRows"
  1. Unhide columns
Application.Run "XLGL.UnhideColumns"
  1. Prepare print layout for active worksheet
Application.Run "XLGL.PrintLayout"
  1. Create a copy of the active worksheet
Application.Run "CopyCurrentWorksheet"
  1. Switch language
Application.Run "XLGL.SwitchLanguage"

Edited: Monday, January 13, 2025

Was this article helpful?

Thank you! Your feedback matters.

We'd love to hear your thoughts! Please provide a comment before submitting.

Thank you for your message!

Would you like a Logicim team member to reply to your message?

If so, please enter your email address below.

You will also receive a copy of your comment.

We protect your personal information.

Thank you for your message!

Verify your inbox or spam folder to find the copy of your comment.
Contact clientcare@logicimtech.com if you didn't receive it.

Related articles

No related articles found

Can't find what you're looking for?

You can Contact us so we can address your question.