I've read other posts on this topic, and I know the solution to the specific error may be permissions. I also get the point about generally doing checks prior to errors occurring - as one person said, traffic lights are better than ambulances, and that was also my philosophy when I was a professional programmer (many moons ago). However, for this app, it is intended to go straight in and read the previously-set google spreadsheet for convenience of use. I want to trap the error that can occur if something is wrong to give the user a chance to then go and change the file the app points to, for instance, but this error forces a close of the whole app when you have acknowledged it, thus preventing the user from going to the screen where they can point the app to a different google sheet.
So, how can this error be trapped to stop it blowing up the execution of the program?