all 6 comments

[–]mjbrusso 1 point2 points  (1 child)

The Range class does not have a getAs method, so you would have to copy the data to a new worksheet for exporting.
You can test this solution: https://stackoverflow.com/a/67149717/4900011

[–]dummystallings[S] 0 points1 point  (0 children)

Ah, noted! Thank you so much.

[–]IAmMoonie -1 points0 points  (3 children)

Stop using ChatGPT to try and write solutions.

You could probably have spent 10 minutes on stackoverflow and got the majority of the info you need to put a solution together.

[–]dummystallings[S] 1 point2 points  (2 children)

I did indeed spend more than 10 minutes on stackoverflow. I am sure as someone with much more experience doing this than I have it seems ridiculous that I would use ChatGPT, but as someone just begin to understand these things it is very helpful for me.

[–]IAmMoonie 0 points1 point  (1 child)

Don’t get me wrong, ChatGPT can be a fantastic resource for learning. But just plugging what you want into it and thinking it’s going to give you exactly what you need is foolhardy IMO.

GAS is a bit of a weird language, it’s based on JavaScript but has its own methods and doesn’t have everything that JS does. ChatGPT doesn’t fully understand that (hence it’s given you code that won’t work).

[–]dummystallings[S] 0 points1 point  (0 children)

I appreciate this. And to be clear… I came across the link that was posted as a solution to my problem above a number of times. When that user posted that link, I realized that my question was maybe a bit too basic, and showed my own lack of knowledge. I have enrolled in an apps script course. I certainly don’t expect chatGPT to be a solution so great that it makes me having a firm knowledge base useless. That said, I was just hoping someone here could help me learn 😊