class Browser method .msgBox()

Browser is the Apps Script service.

.msgBox() is the method name you will see after a dot in your code.

What it does

Shows a message box with OK or other buttons.

Why it's used

  • Quick OK dialog in simple scripts without custom HTML.
  • Confirm an action in older or lightweight workflows.

Common errors

  • Forgetting parentheses on msgBox. Write Browser.msgBox(), not Browser.msgBox or msgBox by itself.
  • Skipping dots between chained calls. Each step needs a dot, like Browser.msgBox().
  • Adding spaces where they do not belong. Write Browser.msgBox(), not Browser .msgBox(), Browser.msgBox (), or Browser . msgBox().
  • Wrong capitalization. Use Browser and msgBox, not browser or msgbox.

Explore

Related methods

  • .buttons()

    Returns button constants used with msgBox and inputBox.

  • .inputBox()

    Shows a dialog that asks the user to type a response.

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about Browser.msgBox().

Browse the blog
Big Year 2027 calendar: the whole year on one Google Sheet

Free 2027 calendar.

Copy it to your Google Drive.

Get it free