Hi Rachel – would really need to see your script in order to diagnose. That said it looks like the saveDatasheet function is expecting an SsimObject (for its first argument) and not getting it. An SsimObject is either a SsimLibrary, Project or Scenario. However if you are using the saveDatasheet fucntion to save a scenario-level datasheet (as you describe above), then this first argument must be a Scenario object. Perhaps check that this first argument is in fact a valid Scenario object before making the call to saveDatasheet function?
So something like this:
myScenario = scenario(myProject, scenario = “Test”)
sheetName = “STSim_RunControl”
mySheet = datasheet(myScenario,name=sheetName)
myScenario # Add this line to check the scenario object is set correctly before calling saveDatasheet