Select to view content in your preferred language

Start ArcMap programmatically, run code at startup in C#

2804
10
10-28-2010 06:01 AM
CarlosPiccirillo
Emerging Contributor
Hi everyone,

I have a dozen mxds that I run during the night from Windows Task Scheduler. They start ArcMap automatically, run code to process some data and then shut down. Now I need to convert these from VBA to C# since VBA will no longer be supported at ArcGIS 10 and I am lost on how to start ArcMap, run code and lastly shut down ArcMap programmatically. I've seen a few post both here and the old forms on how to start ArcMap automatically but nothing on how to run code at start up. In the VBA code, there is code in the MxDocument_OpenDocument function to run the entire thing including shutdown. But in a standalone C# application, there is no such thing as MxDocument_OpenDocument so how do I get my code to run at start up?

Thanks,
Carlos
0 Kudos
10 Replies
GuillermoMarinez
Deactivated User
thanks chump4life, the code works very well, this code apply for many things that do you want run in background like a schedule task.
0 Kudos