79427280

Date: 2025-02-10 13:57:16
Score: 7.5 🚩
Natty:
Report link

I have the below and it is saving all the sheets rather than just the one called 'Commission'. Does anyone have a quick fix for this. It works perfectly other than that. Thank you in advance.

var ssID = SpreadsheetApp.getActiveSpreadsheet().getId;

var sheetName = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Commission");

var fileName = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Commission").getRange("A4").getDisplayValue();

var folder = DriveApp.getFoldersByName("Speedy Commissions").next();

var Blob = sheetName.getParent().getBlob().getAs('application/pdf');

folder.createFile(Blob).setName(fileName);

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • RegEx Blacklisted phrase (3): Thank you in advance
  • RegEx Blacklisted phrase (3): Does anyone have a quick
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Vicki Allan