Cannot open current map document

Discussion created by Meulebeke on Jul 29, 2011
I'm new to python and I'm trying to change one of our vba scripts to python so that it will work in later versions of arcmap

The script does the following
The user selects a polygon and presses a UI Button
A window pops up with a combobox filled with values from a access database, the user selects one and presses a 'Next' button
The scripts does a 'select by location' on all other layers, using the selected polygon. 
The data from the access database and the layers is exported to an excel report.

So far I have the window popping up with the data of the access database,  I can select one and export it to the excel report.  But when I try using the current map document I'm getting an error 'cannot open map document'

mxd = arcpy.mapping.MapDocument("CURRENT")

The script is running in the foreground.

What could be the problem? I'm stuck here