Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am involved on a project which is about Generating 2 maps via running macros in Arcmap 9.3.

It works fine when user push the "run macro" button but now I want to call arcmap from a web page.

It opens arcmap file successfully but I was wondering is there a way to run macro without clicking? This project is going to be part of web application and must work automatically.

Thank you

share|improve this question
up vote 4 down vote accepted

I am not sure on what you are trying to achieve by opening ArcMap from a webpage, and maybe that may not be the most wise thing to do.

Nonetheless what you need to do, is to call your method on the IDocumentEvents:OpenDocument event.

That way, your VBA code will be called whenever the particular Map document is opened, and there is no need for the user to click on any button.

share|improve this answer

If you want to call the macros in ArcGIS from a web page, you need to use Python to do the trick. It is quite easy to do. Just export the macro you wrote into script in .py. And use python to run the .py script. If you want to use a web page to call that and return result to the web page, then there are several solutions. You can look up for python web server.

share|improve this answer
and how exactly do you suggest that one export the VBA macro into Python? – Devdatta Tengshe Feb 26 '11 at 20:26
I did not intend to use VBA at all. Actually, the OP did not mention anything about VBA. And VBA is obsolete. So, I am not sure why would you want to do that. To export a model in ArcGIS 9, do the following: In ArcGIS 9 -> open Model window -> Model -> Export -> To Script -> Python. At last, I was giving a solution to use ArcGIS as a "ArcGIS Server". Using Python, you can easily use a gateway in web server to expose the API. – weliam Feb 27 '11 at 19:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.