0% found this document useful (0 votes)
388 views13 pages

Office Scripts With ChatGPT

This document discusses how Office Scripts can be used to automate tasks in Excel without needing VBA or advanced coding skills. It provides an example where ChatGPT is prompted to write an Office Script that will generate a new "Table of Contents" sheet containing hyperlinks to each sheet in the current Excel file. The script generated by ChatGPT is able to automatically perform this task when run in Excel. The document also outlines the requirements for using Office Scripts, such as having a commercial Microsoft 365 license and internet connectivity.

Uploaded by

Robin Kavalon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
388 views13 pages

Office Scripts With ChatGPT

This document discusses how Office Scripts can be used to automate tasks in Excel without needing VBA or advanced coding skills. It provides an example where ChatGPT is prompted to write an Office Script that will generate a new "Table of Contents" sheet containing hyperlinks to each sheet in the current Excel file. The script generated by ChatGPT is able to automatically perform this task when run in Excel. The document also outlines the requirements for using Office Scripts, such as having a commercial Microsoft 365 license and internet connectivity.

Uploaded by

Robin Kavalon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

The future of

automation!

VBA Office Scripts


by ChatGPT

AUTOMATICALLY INSTERT
TABLE OF CONTENTS

SWIPE

By Mynda Treacy | Microsoft MVP © My Online Training Hub


VBA is the OLD way to Automate Excel

VBA’s limitation is it’s tied


to the desktop. VBA cannot
and never will be able to
execute in Excel online.

SWIPE
What are Office Scripts

Record and replay


SWIPE
actions to AUTOMATE
BORING tasks.
The Problem
Sometimes you need a more complex
script than the recorder can handle. For
that you need JavaScript or TypeScript
skills. I DON’T HAVE THESE SKILLS!

SWIPE
The Solution - ChatGPT

Ask ChatGPT to
write the script.

SWIPE
The Scenario

Insert a new sheet in the


file containing a table of
contents with hyperlinks to
each sheet.

SWIPE
The Prompt

"Write an Excel Office Script to generate a


new Table of Contents sheet called "TOC"
that contains a hyperlink to each sheet in
the current file. If there is already a sheet
called "TOC", delete it before creating the
new sheet. Start the table of contents
hyperlinks in cell B3. Format the hyperlinks
in blue font with an underline. Place a
heading in cell B1 of the "TOC" sheet with
the text "Table of Contents" in black bold
font, size 18. Hide the gridlines on the “TOC”
sheet. Annotate the script to explain what
each step in the script does."

SWIPE
The Response

SWIPE

Download Script
Inserting the Script in Excel
Open Excel Desktop or Excel Online

Paste code
from ChatGPT

SWIPE
Using the Script

SWIPE

Click Run
The Result

New sheet with


Table of Contents
and hyperlinks to SWIPE
each sheet.
Office Scripts Requirements

Office Scripts is available to Excel users with the following:

1. Excel for Windows (version 2210 or higher), Excel for


Mac, or Excel Online.

2. OneDrive for Business.

3. Any commercial or educational Microsoft 365 license


with access to the Microsoft 365 Office desktop apps,
such as:
• Office 365 Business or Business Premium
• Office 365 ProPlus or ProPlus for Devices
• Office 365 Enterprise E3 or E5
• Office 365 A3 or A5

4. Internet connectivity with connected experiences


enabled.

SWIPE
I help you STAND OUT from the
crowd with skills that will
TRANSFORM your CAREER
Get your skills up to speed with my courses
Follow me for tips and tutorials

Mynda Treacy | Microsoft MVP

You might also like