The RASONRunnerSetup.exe installer must be run first to add RASON Solve under External Tools in Microsoft Power BI and to add the RASON tab in Microsoft Excel. For more information, see the previous chapter on installing RASON Runner.

Step 19:  Exporting Model to Excel to be solved in Excel.

In addition to exporting results, RASON Desktop allows you to export the full model to Excel, where it can be executed directly within an Excel workbook. This enables users to run the model, explore different scenarios, and analyze results without returning to Visual Studio Code.

RASON Runner requires the export destination to be a previously saved Excel workbook. This example saves the workbook as ProductMixExample.xlsx.

Return to the RASON Desktop Extension in Visual Studio Code and click Refresh under Excel Workbooks. 

Figure 27: Refresh Excel Workbooks

Refresh Excel Workbooks

Afterwards, select the ProductMix4.json tab and click the Export Model  button in the Visual Studio Code interface.

Figure 28: Export RASON Model to Excel

Then select Export to Excel at the top of screen. 

Figure 29: Select Export to Excel

Select ProductMixExample.xlsx from the list.

Figure 30: Select correct Excel instance

Choose where to export the model

Notice the message in Visual Studio Code (lower right) indicating the model export was successful. 

Figure 31: Model export successful.

RASON model exported successfully

Once exported, the model can be executed directly within Excel, allowing users to analyze results and explore different scenarios without leaving Excel.

Step 20:  Solve the model in Excel

Click to Excel, and then select RASON – Solve

See the previous chapter for information on the Frontline Login icon.   

Figure 32: Click External Tools - Solve to solve the exported RASON model

When the model is solved from Excel using RASON Runner, the RASON Solve Result dialog displays the solve status and available outputs. In this example, the message confirms that the Solver found a feasible optimal solution and that all constraints and optimality conditions were satisfied. The dialog also lists each result (dataframe) returned by the model, in this case the objective value, total, and the decision variable array, x.

For each result, select a destination range in the Excel workbook where the values should be written. The listed dimensions indicate the size of the output range required. For example, “total” requires a 2-row by 1-column range, while “x” requires a 4-row by 1-column range. After selecting the destination ranges, click Write to Sheet to insert the results into the workbook.

Figure 33: Solving:  Excel Model dialog

RASON Solve Result dialog

Step 21:  Viewing the results.

After executing the model in Excel via the RASON tab, the updated values in the worksheet reflect the optimal solution returned from the RASON.net server. Results can be further explored using Excel charts to better understand the impact of constraints and the distribution of production across products.

Figure 34: Updated Results in Excel

A simple Excel chart is shown in the figure below, displaying the optimal production quantities for each product along with the final objective function value.

Figure 35: Simple Excel Visual

The previous sections demonstrated how to export and solve a RASON model in both Power BI and Excel. The next step is to connect the model more fully to each environment by importing data from Power BI or Excel and writing results back to the same report or workbook. This creates a self-contained Power BI report or Excel workbook that can be solved and reviewed directly, without needing to return to Visual Studio Code.  Note that edits to the RASON model itself must be performed in RAContinue with Data Import and Write-BackSON Desktop within the Visual Studio Code environment. 

This completes the basic workflow for exporting and solving the ProductMix4 optimization model in both Microsoft Power BI and Excel. The next section shows how to export a RASON simulation model, where results may include statistics, trials, percentiles, and other simulation outputs. As with optimization models, runtime users can work with exported simulation models directly in Power BI or Excel, while edits to the RASON model itself should still be made in RASON Desktop within Visual Studio Code.