A few months ago Ralph [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=001256;p=1#000001"]posted some other ideas[/url] relating to problems with appends. Does this discussion of range names help at all with your situation? This often seems to be the root problem of appends not working as expected.
Expanding on the filters topic a little, I like to double check that the filter name I set in the code actually worked, because if the name you specified in your code doesn't exist in the model, Monarch won't stop or complain. It will just keep on going with the current data set.
I took a look at the other discussion, but didn't seem like it helped my situation. I am indeed incrementing by 1 in the code, I did not include entire code, since the issue was with the monarch code rather than the loop. I believe the code I am using is being executed because when I go through step mode (F8) it gets highlighted and I see monarch flash briefly. It is to quick for me to see what messages, if any, are displayed.
'Create New File if GLASC, otherwise append data
If i = 1 Then
exportfile = MonarchObj.jetExportTable(stFileLoc & "GradTransport.xls", "GradTransport", 0)
exportfile = MonarchObj.jetExportTable(stFileLoc & "GradTransport.xls", "GradTransport", 2)
/quoteIf i is incrementing each time you loop and when you get to your if export if statement and the append flag doesn't change, I don't know what is happening. Maybe someone else can answer why. I throw it open to anyone who may have an answer.
There is a possible work-a-round however if you are creating a new file each time and not overwriting an existing file. If this is a new file with a different name each time, you can set the append flag to 2 and leave it at that. This will create the file and append each time. You only have to have the append flag set to 0 only if you want to overwrite an existing file.
Thanks for your suggestion. I tried it, unfortunately it didn't make a difference. The next thing I've tried is to save them to separate files using the "i" loop counter as the differentiator. (GradTransport1.xls, GradTransport2.xls, etc.) This created the export for all the files. Now I have 5 files instead of one. Not sure why I am unable to save into one file. Could the problem be due to the col. heading. For example, all the files when viewed in excel begin in Col A and end in Col K. The only difference I noted were that some files had a heading of School and others College. Do the headers need to be the same. I'll see what that does.
I'm glad you have it figured out. Yes, column headings need to be the same when you append to a file. You can append fewer columns with the same name but you can't have more columns in your append export. For example, in your first export, you export columns A thru K. You can't then append an export with columns A thru L.
BTW, the order of the columns does not matter with the append, the columns just have to be there.