2.6 KiB
2.6 KiB
GL Accounts Excel API - Client Delivery
Recommended Files
Send these files to the client:
GL_Accounts_Client_Template.xlsxGLAccountsExcelApi.basgl_accounts_sql_poc.sqlGL_Accounts_Functions_Documentation.pdf
Why This Package Is Stable
GL_Accounts_Client_Template.xlsx is macro-free and contains no active UDF
formulas. It does not open ODBC connections when the workbook starts, so Excel
can load it normally even before the client database connection is configured.
The previous .xlsm proof-of-concept workbooks are not recommended for client
delivery because Microsoft 365 may inspect or recalculate embedded VBA/UDF
formulas while opening the workbook. That can block Excel at Opening ... 0%
if ODBC, macro trust, or the database is not ready.
Client Setup Flow
- Apply
gl_accounts_sql_poc.sqlon the target database. - Create a PostgreSQL ODBC System DSN, for example
TradonGLApi, then configureGL_API_CONNECTION_STRINGinGLAccountsExcelApi.basasDSN=TradonGLApi;Uid=tradon_readonly;Pwd=...;. - Import
GLAccountsExcelApi.basinto Excel VBA, or deploy it through the client's approved add-in/macro process. - Open
GL_Accounts_Client_Template.xlsx. - On the
Functionssheet, runInstallGLApiFormulasto mark result cells as ready. This does not write live Excel formulas. - Run
RefreshGLApito call the database, write plain result values, then disable database calls again.
Implemented Excel Functions
GetAccountBaseAmountGetAccountRealBaseAmountGetAccountAmountGetAccountAbbrGetAccountNameGetAccountContactGetAccountContactCodeGetAccountContactName
All functions use:
(companyKey, accountCode, currencyIso, valueDate)
Operational Notes
currencyIsocurrently filters the transaction currency. It is not yet an output conversion currency.GetAccountContactis kept for backward compatibility and returns party code first, name fallback.GetAccountContactCodereturns party code first.GetAccountContactNamereturns party name first.- The VBA module starts with database calls disabled, so copy/paste cannot open ODBC connections by itself.
InstallGLApiFormulasprepares result cells without creating liveGetAccount...worksheet formulas.RefreshGLApienables database calls only during the macro execution, clears the cache, evaluates each formula text, writes plain values, then disables database calls again.ClearGLApiFormulasremoves any live formulas from result cells and replaces them with#GLAPI_OFF.DisableGLApiturns database calls off again and closes the ODBC connection.