Need a customized project? We build it to your exact requirements.Contact us on WhatsApp

Password Protect Google Sheets – Free Apps Script

E40 Tools & Utilities Premium Plan Weekly Plan VIP Premium Plan
❤️
Need a Custom Business Solution?
Connect with us on WhatsApp to discuss your requirements. Our team will design and develop a tailored software solution aligned with your business workflow, operational needs, and growth objectives.
How to Password Protect Google Sheets Using Apps Script (Free Code) | E40
You get
  • Google Sheet link
  • Source code file
  • Resale rights
  • Edit rights
  • Setup guide
  • AI setup help

Key Features

Password dialog locks the whole spreadsheet All sheets hidden automatically on open Separate user and admin passwords Lockout for 5 minutes after 3 wrong attempts Every access attempt logged with timestamp email and type Admin-only Access Log sheet Auto Lock re-locks the sheet every 5 minutes Configurable passwords attempts and lockout duration Choose which sheets stay public No add-ons or extensions needed Copy and paste free Apps Script

Description

Google Sheets sharing is all or nothing: anyone with access sees everything in the file. This puts a password in front of the spreadsheet itself — sheets stay hidden until the right password is entered, with two levels, a lockout and a log of who tried.

How the lock works

On open, every sheet is hidden and a password dialog appears. Nothing is readable until the password is accepted, and you choose which sheets, if any, stay public to everyone. Auto Lock re-locks the file every five minutes, so a sheet left open on an unattended screen closes itself rather than staying open all afternoon.

Two passwords, not one

There is a user password and an admin password. Users get the working sheets; the admin gets those plus the Access Log, which nobody else can see. That separation is the difference between hiding data from a colleague and knowing who has been looking at it.

Against guessing

Three wrong attempts triggers a five-minute lockout, so the password cannot be brute-forced by repeated tries. Every attempt — successful or not — is logged with the timestamp, the Google account email and the type of access, so the record exists whether or not anyone got in.

Setup

The passwords, the number of allowed attempts and the lockout duration are all configurable at the top of the script. There is no add-on to install, no marketplace extension and no subscription — the code is pasted into the sheet's own Apps Script editor.

A practical note: this protects the spreadsheet interface, not the underlying file permissions. Keep the file itself shared only with people who should have it, and use this to control what they see once inside.

Requirements

  • A Google account (Gmail or Google Workspace)
  • The Google Sheet you want to protect
  • Apps Script editor access on that sheet (Extensions → Apps Script)
  • No add-ons, extensions or subscriptions needed

What's Included

  • Complete Apps Script code to paste into your sheet
  • Password dialog that hides every sheet until unlocked
  • Separate user and admin passwords
  • Lockout after repeated wrong attempts
  • Admin-only Access Log sheet with timestamp, email and type
  • Auto Lock re-locking the sheet on a timer
  • Configurable passwords, attempt limit and lockout duration
  • Step-by-step video walkthrough
  • Free support from the developer

Item Details

Versionv1.0
PublishedFeb 19, 2026
PlatformGoogle Apps Script
DatabaseGoogle Sheets
CategoryTools & Utilities
Tagspassword protect google sheetspassword protect google sheets apps scripthow to password protect google sheetslock google spreadsheet with passwordprotect google sheet with passwordpassword protect google sheet from viewingpassword protect google sheets tabhide sheets with password
VideoWatch walkthrough
LicenseRegular License
Subscription Verification Required
This is a free file. Subscribe to our YouTube channel to unlock the source code + Google Sheet. One click — no payment. Google only confirms you are subscribed.
Verify Now
Free download

Subscribe & Unlock Source Code

Subscribe on YouTube, then verify with one click. No payment, no card. Google is used only to confirm your subscription.

What you get

  • Code.gs + HTML filesThe complete Apps Script project
  • Google SheetYour own copy with the data
  • Setup guideInstall steps from start to finish

Not subscribed yet? Subscribe to our channel

Browse More Free Files

Need This Customized For Your Business?

Extra modules, your branding, integrations or reports built on top of this file. You get a clear quote and timeline before any work starts, and support after delivery.

400+
Projects Delivered
91+
Countries Served

What We Customize

Features & Functions
Add new features, modify existing scripts, custom formulas & automations
API & Integrations
Connect with WhatsApp, Payment Gateways, CRM & more
Design & UI Changes
Custom branding, layout redesign, dark mode, mobile optimization
Full Custom Projects
Dashboards, billing systems, inventory, CRM — built from scratch
Get Free Quote on WhatsApp

20-30% advance to start • Clear quote before work begins • Support included after delivery

Free
Source Code File

People choose these

Paid picks from the same category

Grocery Store POS System with Barcode Scanner | Google Sheet POS + Apps Script + AI Grocery Store POS System with Barcode Scanner | Google Sheet POS + Apps Script + AI 277 views this month Apps Script How to Build an App with Claude AI: Complete Church Management System in Google Sheets How to Build an App with Claude AI: Complete Church Management System in Google Sheets 163 views this month Apps Script Manage Your Installments Like a Pro: Complete Web App Demo Manage Your Installments Like a Pro: Complete Web App Demo 208 views this month PHP

Reviews & Feedback

What buyers and viewers say about How to Password Protect Google Sheets Using Apps Script (Free Code) | E40.

No star ratings yet Tap a star to be the first to rate it.
6 comments from
YouTube viewers
Sort
@DurvishJawaleOfficial via YouTube
Thank you sir Now onwards our google sheets will be safe❤❤
1 like on YouTube
@csptechinspiration via YouTube
Anyone can edit the script...!! Is it script also locked?
@sundusayaanle-s1j via YouTube
❗If you share links of Google examination sheet your friend and allow to fill same date in sheets but don't apply to make copy sheet or use extensions So how can do it?
@Creepy000 via YouTube
Wow amazing 😻 😊
@irfanchauhan495 via YouTube
Superb 🎉... Thank You Very Much Sir
@khanasadullah5125 via YouTube
Thankyou guru ji