Allows a SQL Statement to be run when required. Used in conjunction with XL3Link to trigger the execution.

XL3RunSQL( ExcecuteSQL, Connection, SQLStatement, [TableSheet], [Table])

ParameterDescription
ExecuteSQLA cell reference that contains TRUE when the SQL Statement should be run. After execution, the cell reference will be set to FALSE or an error message if an error has occurred.
ConnectionThe connection to use to connect to the database. This can either be the Connection ID of a workbook's relational connection or a connection string.
SQLStatementThe SQL statement to run
[TableSheet]Optional - Worksheet name containing query table or Anaplan XL Table to refresh after the SQL has run
[Table]Optional - The name of the query table or Anaplan XL Table to refresh after the SQL has run

XL3RunSql(J3,CommentData!$G$1,L3)

When J3 is set to TRUE (via an XL3Link) then the SQL statement in L3 is run using the connection string specified in CommentData!G1. After completion, J3 will be reset to FALSE - ready for the next update by an XL3Link. Note that to use this on Anaplan XL Web Edition, the XL3Link should be of type 3 (Link with submit changes on the web).