Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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