gsheetsCode.js
/** This code contains custom functions that require the gsheets SpreadsheetApp API
* Validates that the required pure component data named ranges are available.
*
* @customfunction
*/
This code contains custom functions that require the gsheets SpreadsheetApp API
Validates that the required pure component data named ranges are available.
This code contains custom functions that require the gsheets SpreadsheetApp API Validates that the required pure component data named ranges are available .
function validateWorkbook(){
  var PDataExists  = false
  var PDataPropertiesExist = false
  var PDataPropertyNamesExist = false
  var myWorkbook = SpreadsheetApp.getActiveSpreadsheet()
  var myRanges = myWorkbook.getNamedRanges()
  var numberOfSheets = SpreadsheetApp.getActiveSpreadsheet().getNumSheets()
  var mySheets = SpreadsheetApp.getActiveSpreadsheet().getSheets()
  for(var i = 0; i < myRanges.length; i++){
    if(myRanges[i].getName() === "PData_Properties"){
       PDataPropertiesExist = true
    }
    if(myRanges[i].getName() === "PData_PropertyNames"){
       PDataPropertyNamesExist = true
    }
  }
    if(PDataPropertiesExist && PDataPropertyNamesExist){
      return true
    }else{
      return false
    }
}
function validateWorkbook ( ) { var PDataExists = false var PDataPropertiesExist = false var PDataPropertyNamesExist = false var myWorkbook = SpreadsheetApp . getActiveSpreadsheet ( ) var myRanges = myWorkbook . getNamedRanges ( ) var numberOfSheets = SpreadsheetApp . getActiveSpreadsheet ( ) . getNumSheets ( ) var mySheets = SpreadsheetApp . getActiveSpreadsheet ( ) . getSheets ( ) for ( var i = 0 ; i < myRanges . length ; i ++ ) { if ( myRanges [ i ] . getName ( ) === "PData_Properties" ) { PDataPropertiesExist = true } if ( myRanges [ i ] . getName ( ) === "PData_PropertyNames" ) { PDataPropertyNamesExist = true } } if ( PDataPropertiesExist && PDataPropertyNamesExist ) { return true } else { return false } }
This code contains custom functions that require the gsheets SpreadsheetApp API
Validates that the required pure component data named ranges are available.
This code contains custom functions that require the gsheets SpreadsheetApp API Validates that the required pure component data named ranges are available .