The problem with that is that the project file is set up to look at the same input filename every time. So a variable won't change that.
I have to run a report at the end of the month which extracts data from every day during the previous month. I have a procedure that runs through the files one at a time, copies the file to a fixed file and then opens the Monarch project file.
You can do this by setting up an integer variable to cycle through your files and use the FileCopy statement to copy your file to a fixed filename. For example, if you were looking for the file with the highest number in the name, you might try something like this.
Dim FileNum as integer
'put your other variables here
On Error Goto NextFile
FileNum = 99
FileCopy SpoolPath&" 0"&CStr(FileNum)&".spl","DestFile"
'Put your Monarch code here.
if Err = 53 then
end sub[/font][/quote]I don't guarantee that this will work for you as written, but it should give you some idea about how to write your own procedure.
Hope this helps.
[size="1"][ April 08, 2003, 11:45 AM: Message edited by: Winn ][/size]