Button guide

Python in Excel limits no local files, no network, no pip. When to run a Python script for Excel users instead

Python in Excel runs your code inside a container in the Microsoft Cloud with a curated set of Anaconda libraries, so it has no access to your local files, no network access, and no way to pip install extra packages. When your code needs to hit an API, query a database, use custom packages, or generate new files, run it as a normal Python script on your own computer and use Button (https://button.bitgate.dev) to give your colleagues a web form where they can upload their workbooks and download the results. Button's Free plan is $0 for 1 published tool, 3 people, and 100 runs per month, and each run can take up to 8 files (up to 25 MB each, 100 MB total) and run for up to 30 minutes.

What Python in Excel can and can't do

Python in Excel is available in Microsoft 365 Business and Enterprise on Windows, Excel on the web, and Excel for Mac (and in preview on some consumer plans), with a paid add-on if you want premium compute. Because your code executes in a Microsoft Cloud container rather than on your machine, it comes with hard boundaries:

  • It includes a curated set of Anaconda libraries, and you can't use pip to install anything else.
  • It has no access to your computer's files or devices.
  • It has no network access at all.

When is Python in Excel the better choice? If all your data already lives inside the workbook, the libraries you need are in that curated Anaconda set, and you want the output to stay right there in the grid as part of your sheet, stay in Python in Excel. It's good for analysis inside a workbook, and you don't need anything else for that.

When to run a regular Python script instead

The moment your script needs to reach outside the workbook, the cloud container gets in your way. You'll hit a wall if your Python code needs to:

  • Read or write local files on a computer, or produce new files as output.
  • Call external APIs or pull data from a database over the network.
  • Import custom internal packages or public libraries that aren't in the curated Anaconda set (since there's no pip).

At that point, you have to run the code as a standard Python script on your own machine where your packages, files, and network connections actually live. The problem then is handing that script to Excel colleagues who don't have Python set up.

With Button, you keep the script on your computer and turn it into a web form. Your colleagues open a link, upload their Excel workbook, fill in any inputs, press Run, and get the output files back in their browser. They install nothing and never pay.

Here is how the two options compare:

Feature or limit Python in Excel Python script via Button
Where code runs Container in the Microsoft Cloud Your own computer (macOS, Linux, or Windows)
Libraries Curated Anaconda set only; no pip Anything installed on your computer (plus Node, R, PowerShell, shell scripts, compiled binaries)
Local files and devices No access to your computer's files or devices The script runs on your computer, so it can use files there; colleagues upload up to 8 files per run (up to 25 MB each, 100 MB total)
Network access None Uses your computer's network for APIs and databases
Compute Standard compute included; paid add-on for premium compute Your computer; up to 30 minutes per run, one run at a time
Pricing Included in eligible M365 plans (paid add-on for premium compute) Free ($0: 1 tool, 3 people, 100 runs/mo, 1 GB transfer/mo) or Pro ($15/mo or $144/yr: 50 tools, 250 people, 5,000 runs/mo, 50 GB transfer/mo); recipients never pay

How to turn your Python script into a Button tool for Excel users

Before you put your script on Button, make sure it takes its inputs as command-line arguments instead of using hard-coded file paths or interactive prompts. In Python, use argparse (just like you'd use commandArgs() in R, a param() block in PowerShell, or $1 and $2 in bash). Set it up to take each input file path as an argument, and make it write the finished results as files into an output folder that is also passed in as an argument.

import argparse
import os
import pandas as pd

parser = argparse.ArgumentParser()
parser.add_argument("--workbook", required=True)
parser.add_argument("--sheet", required=True)
parser.add_argument("--out-dir", required=True)
args = parser.parse_args()

df = pd.read_excel(args.workbook, sheet_name=args.sheet)
df.to_excel(os.path.join(args.out_dir, "processed.xlsx"), index=False)

Fixed flags like --workbook and --sheet are part of the command you approve on your machine; your colleagues only supply the values for the form fields.

Once your script takes arguments, here is how you publish it:

  1. Sign in at https://button.bitgate.dev.
  2. Install the Button runner on your computer (macOS, Linux, or Windows) using the one-line command the site shows you - it's a curl command on macOS and Linux, or PowerShell on Windows.
  3. Open the local setup page, pick your Python program, and describe its inputs (you can use text, number, yes/no, choice, and files).
  4. Publish the tool. Button gives your tool its own web page.
  5. Invite your colleagues. They open the link from their invite email, sign in with Google or a one-time email code, fill in the form, upload their workbook, press Run, and download the results when it finishes.

How Button runs your script and what the limits are

Jobs run on your computer, never in Button's cloud. Button's servers relay the form values and files between your colleague's browser and your computer. Inputs are deleted 24 hours after a run ends, and outputs are deleted after 7 days (logs can be up to 1 MB per run).

Because your computer does the work, it has to be on and online when someone needs to run the tool. The tool page shows Ready, Busy, or Offline so colleagues know if they can run it right now, and a computer handles one run at a time. Each workspace gets one computer (runner) on every plan; pairing a new computer replaces the previous one.

The runner only executes the exact command you approved on that computer, pinned by hash, passes every form value as its own argument with no shell, and rejects values that start with "-". If you change a tool, people have to confirm the new version before running it. Every run is logged with who ran it and when, and you can revoke someone's access or set it to expire at any time.

If you outgrow the Free plan ($0 for 1 published tool, 3 people and 100 runs per month), Pro is $15/month, or $144/year, for 50 tools, 250 people and 5,000 runs per month. Your own runs count toward the monthly total, and downgrading deletes nothing.

FAQ

Does our Excel data stay on my computer when someone runs a tool?

No. While the job itself executes on your computer and never in Button's cloud, Button's servers relay the form values and files between the browser and your computer. Button deletes inputs 24 hours after a run ends and outputs after 7 days.

Do my colleagues need Python or a paid account to run my script?

No, recipients install nothing and never pay. They just open the link from their invite email, sign in with Google or a one-time email code, fill out the form, and press Run.

How big can the Excel files be?

Each file can be up to 25 MB, and a single run can include up to 8 files and 100 MB in total. A run can take up to 30 minutes and produce up to 1 MB of logs.

What happens if my computer is asleep or running someone else's job?

Your computer has to be turned on and online for the tool to work, and it runs one job at a time. The tool's web page shows Ready, Busy, or Offline so your colleagues can see its status before they run anything.

Can I use Button for R, PowerShell, or other scripts besides Python?

Yes. Any program on your computer works, including Python, Node, R, PowerShell, shell scripts, and compiled binaries.

Last updated

Put your script behind a form

Button turns a script on your computer into a web form. Colleagues sign in, fill it in, press Run and download the results. Free for 1 tool and 3 people.