7a. Initialise Excel-Flask integration using Jupyter Notebook

The backend is a Flask application that Excel communicates with over HTTP.

  1. Paste the following code into Jupyter Notebook run.ipynb file (see Figure 13).
  2. Press Shift+Enter or Click the Run All button to execute the code and initialise the Flask back end (see Figure 13). If prompted to install ipykernel, proceed with the installation and wait for the code to execute once the installation is complete.
from mf_excel.backend. app import app
from mf_excel.backend. services. config import settings
import threading

def start_flask():
app.run(

host=settings. HOST,
port=settings. PORT,
debug=False,
use_reloader=False
)

threading. Thread (target=start_flask, daemon=True) . start()

print("MacroFrame Forecast backend running")
Figure 13: Jupyter run notebook
Figure 13

7b. Define model parameters in Excel Settings and Run Forecast

  1. Navigate to the Control Sheet and left-click the Settings button to open the Settings sheet (Figure 14).
  2. Figure 14: Settings sheet
    Figure 14
  3. On the Settings sheet, configure the parameters to reflect your forecasting objective. As we are replicating the output of the second example in the macroframe-forecast paper using the same fiscal data, select ols from the forecaster drop‑down menu in column B (see Figure 15).
  4. Figure 15: Settings selection placeholder
    Figure 15
  5. Open the Control sheet and left-click the Run Forecast button. After a successful run, new sheets will be created with forecast outputs and diagnostics.