• Object not being killed (Access 2K SR1 and Excel 2K SR1)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Object not being killed (Access 2K SR1 and Excel 2K SR1)

    Author
    Topic
    #365441

    Hi all

    Got a weird scenario here and I have no idea of how to solve it.

    Here is what I am doing.

    In Access, I am creating various reports for a number of people which is done once a month.

    My logic flow is as follows:
    Create Excel.Application Object
    Retrieve name of first person and report data
    Loop begins
    Open Excel template for the report
    Fill in the template with the data
    Save (as a new file), close and email the report
    Retrieve the name of next person and the
    relevant data
    Loop ends
    Excel.Application.Quit
    Set Excel Object = nothing

    This all works perfectly fine and dandy under Windows 2000, but when I run it on a Windows 95 or Windows 98 machine, the Excel object is not destroyed is I create more than a certain number of reports (about 30 to 45) and it utilised about 95%+ of the CPU usage.

    I have even moved the creation and destruction of the Excel object into the loop and that creates even more havoc on all the operating systems.

    It seams as if Windows’ parrallel processing and/or caching gets in the way and it tries open an Excel spreadsheet using the Excel Object when the object hasn’t been created yet, or even destroy the object when the object hasn’t finished doing some internal processing (and therefore unable to destroy it).

    Anyone got any ideas on how to solve this?

    Thanks in advance!

    James

    Viewing 0 reply threads
    Author
    Replies
    Viewing 0 reply threads
    Reply To: Object not being killed (Access 2K SR1 and Excel 2K SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: