Tuesday 2 July 2024

Limitations

This morning, I wanted to produce a word frequency analysis on the contents of a (Microsoft) Excel worksheet. I thought it possible that it would be quicker to get some code in, rather than write it myself, which would take me a while. Too much quality time relative to the need at hand.

I then thought that Google's Gemini might help, but he simply declined. This was not something that he was going to attempt to help me with.

Microsoft's Copilot, however, was game and suggested all kinds of stuff including a function called 'FreqWords'.

After a while, I worked out that this meant I needed to crank up Visual Basic again.

And after a bit of playing and a few more interchanges with Copilot, he supplied me with the necessary code in text form. I put this into my workbook.

More playing, more exchanges with Copilot and Bing, and I get as far as the Copilot code not compiling, with some error that is far too deep for me in one of the constituent functions. Ah well, says Copilot, try replacing that bit of code with this bit of code. I get a different error.

At which point, having burned up something over an hour, I retire from the fray, at least for the time being. 

And to be fair to Microsoft, trying to correct someone else's code remotely is a pretty tall order. And my Visual Basic coding is pretty rusty. Not done it in a serious way for several years now.

PS 1: along the way, I notice a slightly worrying behaviour. I am typing away and realise that I have made a mistake. I then go back and start over, only to type in exactly the same mistake again. I have to stop for long enough, perhaps a second or so, to give the brain time to disengage and start over. Perhaps this  is because it has packaged up the necessary motor commands up and sent them on their way. Then, when poked, it just does a 'resend' rather than going to the bother of creating a new package...

PS 2: later: I remembered this afternoon about the fine Tech Support service once offered by BT. Because it was BT, you trusted them to take over your PC - using, as I recall, some version of the Citrix offering - and fix it while you watched. They couldn't fix everything, but I thought they did pretty well, certainly with connectivity and Windows issues.

PS 3: still later: had another go, this time leaving the AI behind, and finding to my own way to what might be the horse's mouth at reference 1. Put that in and got it to work as a function from the worksheet, rather than as a function in visual basic. Worked well enough on a chunk of data - it would do as a one-time thing - but then took a very long time to do the real data, so long that in the end I closed it down in task manager, which seemed to leave Excel in a bit of a state. There is also the question of running unknown code on one's PC. OK, so it is not very much code, it is visible and looks harmless enough - but still and all. A corporate IT department would not allow it.

References

Reference 1: https://www.ablebits.com/office-addins-blog/excel-word-frequency-analysis/.

No comments:

Post a Comment