vendredi 22 novembre 2019

Delete specific sheet if it already exists

    spreadsheet.setActiveSheet(spreadsheet.getSheetByName('export'), true); 
    spreadsheet.deleteActiveSheet(); 

This deletes a sheet called "export". However, sometimes this sheet doesnt exist so the script gives me an error. So i'd like to check first if a sheet called "export" exists, and delete it if so. How do I do that, what syntax is needed?

Aucun commentaire:

Enregistrer un commentaire