Kill process, killing before writing to excel

hello, I am trying to automate a script via the process outlined by Andrew Diekman:

https://github.com/andydandy74/DynamoAutomation/blob/master/wiki_images/master-graph.png

At the end of my slave graph I have some wait for nodes before the kill commands. However, for some inexplicable reason, the process keeps dying before the information is fully written in excel. It will write the headers, but nothing else, and then die. However if I run the script by itself, with the Kill process node frozen, and the close excel node still active, it works fine. (writes the whole excel file before closing excel.) How do I get this to work so that it waits for excel to finish populating before dying?
See below. I also tried using the two close document nodes to the right of the KillCurrentProcess node below but the both fail with the same error message. Is it because I am trying to close the current revit file? I tried using passthrough nodes everywhere but nothing seems to work. Please advise!

The KillProcess node really needs to be the absolute last thing that happens in the process. Every Revit Document should be closed and every file that you need should be completed before calling the KillProcess.

This would be the same as Synchronizing to Central and while that is happening, going down to your TaskManger > Right Click and > Kill Process. It would not end well for the Central file.

You should have a PassThrough node right before your KillProcess node to make sure everything is done.

Hello Kraftwerk15,

Thanks for the explination. I am pretty sure that it is the last thing in my graph. Can you see something that I dont see?

This is exactly what I have in the picture above. But is still doesnt want to work. Please advise how I can get it to work. thanks!

Hm. Well I was originally thinking that your “Close Excel” python node should be wired up with an OUT that goes TO a passthrough node which then is wired to the Kill Process. So it would be Sync to Central > Passthrough > Close Excel > Passthrough > Kill Process. Sorry if I did not make that clear now that I read my first post.

Another way that you could look at this is why wait until after the Sync to Central to close the Excel file? It has already completed its purpose before that, so could you just close the Excel file with the Data OUT of the Write Excel node?

Then you could run a test to confirm that the data that you want is completely written to the Excel file. If it is not, there are nodes where you could fire off an email to yourself that explains the situation and then still kill the process or leave the process up if the excel file does not match what you are after.

Oh ok I gotch, I will try that!

This sounds really cool! Which package is this in?
Thanks!

I’m sure there are multiple packages out there that do this. There are some that can write to Slack or other chat applications.

I built a package called Lightning that you can search for on the Package Manager that has an Email node in there. That’s usually what I used during these types of exercises to do what I mentioned above.