Opening part drawing with journal

I have an excel with a list of part numbers, and I would like to open the drawings for each one individually, run a script, and then close the drawing. I was wondering if anyone has code that does something along these lines?

Basic algorithm would be
1 Dialog for excel file
2 Open excel file
3 open the drawing for the part number in row 1
4 run custom script
5 close the drawing
6 open the drawing for the part number in row 2
...