‘This app is blocked’ error when connecting to Google Sheets—how to fix?

I’m getting a message saying “This app is blocked. This app tried to access sensitive info in your Google Account. To keep your account safe, Google blocked this access” when trying to connect to Google Sheets. How can I fix this?

1 reply