Can anyone tell me how to accomplish this?
I want a Python script to run on opening the MXD which would pull an excel worksheet into a GDB and refresh the map.
I only want this to happen in this specific MXD.
Can anyone tell me how to accomplish this?
I want a Python script to run on opening the MXD which would pull an excel worksheet into a GDB and refresh the map.
I only want this to happen in this specific MXD.
You could code within the VBA of the mxd and call the python script within the code wrapper below:
Private Function MxDocument_OpenDocument() As Boolean
End Function
In 10.0, you could use VBA as in artwork21's answer, or write a very simple ArcMap add-in using ArcObjects to run a script tool or shell out to arbitrary executables/scripts on startup, as in this answer.
It would probably be worth waiting for 10.1's Python add-ins if you don't want to write an ArcObjects add-in specifically for this.