Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
547 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Coding in SQL, Python, VBA, JQuery and OfficeScript using AI tools Part six of an eight-part series of blogs |
---|
One of the immediate and obvious ways to use AI tools is to boost your productivity as a programmer. This blog shows how you can use ChatGPT 4 and Google's Bard to write programs in SQL, Python, VBA, JQuery and Office Script (probably the 5 languages Wise Owl use most).
|
In this blog
Nearing the end of our marathon AI coding session, the Office Script question I thought we'd ask is:
Write an OfficeScript program to loop over all of the worksheets in a given workbook, counting the number of active cells in each and presenting this information in a table in a separate workbook
This is a nice simple request, but I'm expecting that the answers won't be as good as for other languages due to the absence of training material out there. Let's find out!
I was expecting ChatGPT to struggle with Office Scripts, but (as so often) was flabbergasted at how good its reply was. It began with a little history lesson:
The first paragraph of this is no longer true - Office Scripts also work in the desktop version of Excel - but the disclaimer does say that the information might be out of date.
Here's the script created:
I don't claim to know Office Scripts as well as my colleague Andy Gould, but this answer looks highly plausible to me (and the explanation of how it works at the end is excellent).
I thought Bard might struggle with this (it is after all a Google tool, and must have some bias towards Google Scripts?), but I didn't think it would make up syntax!
I am no Office Scripts expert, but I'm pretty sure that the getActiveCellCount function only exists in the imagination of Bard.
Once more Bard has taken much less time to arrive at what is superficially a perfectly plausible answer, but with coding (almost more than in any other field of human endeavour) the devil is in the detail!
Parts of this blog |
---|
|
Some other pages relevant to the above blogs include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.