From the course: Office Scripts In Excel: Automating Tasks
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Debugging Office Scripts with console.log() - Microsoft Excel Tutorial
From the course: Office Scripts In Excel: Automating Tasks
Debugging Office Scripts with console.log()
As you dive into developing your own solutions with Office Scripts, it's important to remember that not everything is going to work perfectly on the first try. In this video, I'll highlight console.log(), a particularly helpful tool for troubleshooting code in Office Scripts. To follow along, you'll want to open a new workbook and start by navigating to Automate and then New Script. Let's begin by wiping everything from Line 7 onwards and adding a new line with console.log(). We'll start by printing "Currently active sheet:" followed by selected sheet.getName. Let's run this script.console.log() is Office Script's way of printing messages to the console during script execution. It allows us to see the values of variables and results without altering the worksheet itself. We can see the output at the bottom of our code editor. At first, if we run the script, it might seem underwhelming. We already know this is Sheet 1, however, console.log() proves invaluable when operating through…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Debugging Office Scripts with console.log()4m 2s
-
(Locked)
Collaborating with Office Scripts2m 41s
-
(Locked)
Integrating Office Scripts with Power Automate4m 42s
-
(Locked)
Automating multiple workbooks with Power Automate and Office Scripts6m 5s
-
(Locked)
Challenge: AutoFit and freeze panes for all workbooks1m 26s
-
(Locked)
Solution: AutoFit and freeze panes for all workbooks3m 13s
-
(Locked)
-