Skip to Content

How to copy from a google sheet with "view only" access & disabled "option to download, print, and copy"

How to copy from a  locked google sheet.
1. Download ”Copy Protected Google Sheets” chrome extension from Chrome Web Store.

Note: Its not going to work, but will create a loop hole by allowing us to use inspect browser tool. 

2. Open the protected google sheet and click on the extension, it will prompt a dialog box, Click “Copy Link” button and open the link in a new tab.

3. Open inspect tool on your browser.

4. Copy html body element

5. Paste it on any code editor.

6. Use of any html formatting extension to format the code for easy readability.

Note: I am using Format Selection As HTML

7. After formatting. Save the file as input.html


8. Now I am gonna use a python scripts to extract the information's I need.
import re
import csv

# Input and output file paths
input_file = "input.html"
output_file = "output.csv"

# Define valid prefixes
valid_prefixes = ("1001", "1002", "1301", "1302", "2002", "2021", "2022", "2023", "2024")

# Read HTML file
with open(input_file, "r", encoding="utf-8") as file:
    html = file.read()

# Find all <td> contents
td_values = re.findall(r"<td.*?>(.*?)</td>", html, re.DOTALL | re.IGNORECASE)

extracted_numbers = []

for value in td_values:
    # Clean any inner HTML tags
    clean_value = re.sub(r"<.*?>", "", value).strip()

    # Match pure integer values only
    if re.fullmatch(r"\d+", clean_value):
        # Check if it starts with one of the prefixes
        if clean_value.startswith(valid_prefixes):
            extracted_numbers.append(clean_value)

# Write extracted numbers to CSV
with open(output_file, "w", newline="", encoding="utf-8") as csvfile:
    writer = csv.writer(csvfile)
    for number in extracted_numbers:
        writer.writerow([number])

print(f"{len(extracted_numbers)} long integers extracted and saved to {output_file}")

Note: You can use chatGPT, Gemini or any other tools to help you customize the script that will extract the information's you need. 

9. Run the code and you will see an output.csv file containing the data from the protected sheet.

10.  Wrap up: 

This workaround allows data to be extracted from a protected Google Sheet with view-only access and copy-pasted disabled. It does require some basic technical knowledge, but in the age of AI, coding is far more approachable.

If you are working with a large dataset, you can use this method to extract the data and adjust the code to suit your specific needs.

Disclaimer: Always comply with local laws and data protection regulations when handling any form of Personally Identifiable Information (PII).

How to copy from a google sheet with "view only" access & disabled "option to download, print, and copy"
Iftiaj Alom October 23, 2025
Share this post
Tags