Cant Publish to TIC using Sql Server Script

I am building an automation script using ToadDataPoint replacement variables. When I try to use an Execute Script and publish to TIC I get an error saying there are undefined variables. How can I use a combination of TDP replacement vars and publish to TIC. Or what is supported? I can use this script to save to LS so why can't I use the script to publish>

Here is the SQL Im using that seems to be the problem.

use ReportDatabase
-- Use this declarations when it runs in Automation Script
DECLARE @LedDate DATE = '#ReportDate#'
DECLARE @OfficeCode nvarchar(3) = CAST('#Loop_data_1_SQL.OfficeID#' as nvarchar)

Great question, DMP. Since the Toad Data Point automation can only publish datasets to Toad Intelligence Central and not views, it seems like this variable is confusing the system. A workaround (not very elegant) would to be save the results sets that are created with the script that has the variable to a temp table and then query that temp table and save those result sets to Toad Intelligence Central. Where you can create that temp table depends on your environment.