Excel Export to in-use file try...except problem

Hi all,

When I try to export to a file that is in use, it fails (as it should) with a java.io.fileNotFoundException. What I’d like to do is catch the error and print my own message, but the error doesn’t seem to be getting caught.

Basically:

try: #x=5/0 fpmi.db.exportExcel("mydata.xls", 1, fpmi.db.toDataSet(ExportData)) except: fpmi.gui.messageBox("The file couldn't be overwritten because it is in use.")

With this code the java exception appears anyways. If I intentionally cause an exception in the try (by dividing by 0 for example), then I get the message I expect, however the java file exception never gets caught. Any ideas?

Unfortunately in FactoryPMI you cannot catch some of our errors, the error box will popup.

Alrighty, Thanks!