aglatfelter and Bruce,
I have developed a solution for you using VB script, which I've tested successfully with one of my existing project files. I also use V5.
The first part of the code creates an array (basically a lookup table) which defines which filter name to use for which export folder.
Then it opens the project file and loops through the array, exporting each filter. Finally it properly shuts down Monarch.
Set MonarchObj = CreateObject("Monarch32")
openfile = MonarchObj.SetLogFile("c:monarch eportsVBS.LOG",False)
openfile = MonarchObj.SetProjectFile("C:My Project FilesMy Filtered Project.prj")
for counter = 1 to 3
MonarchObj.CurrentFilter = arfilters(counter,1)
If openfile Then
MonarchObj.ExportTable(arfilters(counter,2) & "Filtered export.xls")
Set Monarchobj = Nothing[/font][/quote]Just copy this code into Notepad, edit the filters and folder names, and the .xls file name too, and save it with a name like "Export Filters.vbs". If you type the quote marks around the name, Notepad won't give the file a .txt extension. Save it to your desktop and you can just double click the icon to run it.
Hope this helps. Let us know how you make out.
I just did a little test run and everything seemed to work.
I did get an error in the script, however.
Error: Object doesnt support this property or method
Source Microsoft VBScript runtime error.
The good news is that the files were created in their respective folders, so the error doesnt really seem to matter.
Thank you so much!
That is correct. Think of the array as (Rows, Columns) so that it builds a little lookup table, where you need one row for each filter item.
The name of the filter goes in the first column, and the name of the destination folder that you want to use for that filter goes in the second column.
Then, since we cannot pass a filter name as a command line parameter, we can take advantage of the object model instead by using a script.
Glad to here that this worked well for you. Odd about that script error - I'm not able to duplicate it.