Solved

Winword will not go away in Access

Posted on 2007-11-27
2
239 Views
Last Modified: 2013-11-28
I have an access application that contains an unbound object frame that shows a Word document.

When the form loads, the following code fills the unbound object frame successfully. This is the code that does that:

Dim WordApp As Word.Application

    Set WordApp = New Word.Application
    Me!OLEUnBound.SourceDoc = sTheCurrentDatabaseDirectory & "BlankDocument.doc"
    Me!OLEUnBound.Action = acOLECreateLink
    Me!OLEUnBound.Requery

On the OnUnload Event of the form, I have:
    Set WordApp = Nothing

After the access application ends, I still have numerous instances of WINWORD in the Task manager.

What am I missing?
0
Comment
Question by:LennyGray
2 Comments
 
LVL 17

Accepted Solution

by:
Chris Mangus earned 500 total points
ID: 20359628
You may want to add WordApp.Quit() before you destroy the WordApp object.
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 20359805
You are dimming Winword in a procedure and setting it to nothing in another procedure.
Perhaps, since the object is not declared as a public, global, or in the form's declaration section,
the 'set to nothing' isn't doing anything.

Try placing the Dim WordApp As Word.Application in the form's declaration section.  


Scott C
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now