DLL's/OLE/Delphi 2.0

I have written a DLL is Delphi 2.0 that takes a TDataset object as its only
parameter and export the data.  The DLL displays a save dialog box, and
depending upon the file type chosen, export the data.  For txt, db, dbf
files, it uses a batch move componant and works fine.  For MS Word, and MS
Excel. I wrote some OLE automation code which works fine... until the
closing application is shut down.  The DLL is only called when it is
needed, and detaches after the export procedure runs.  The error is an
illegal function and the message is: TIMETRAK caused an invalid page fault
module KERNEL32.DLL at 0137:bff858cd.  This only happens when I export
using OLE via the DLL.

Any ideas??

Jonathan Mutnick