parkfairfax
Programmer
I am trying to exit from word using VBA and having some problems doing so. This is my following code which I use several times to create instances of word..
Dim appword As Word.Application, strdoc As String
Set appword = CreateObject("Word.Application"
appword.Visible = True
strdoc = "c:\Report\TOC2.doc"
appword.Documents.Open (strdoc)
Set appword = Nothing
I use the following code to quit..
appword.Quit
Set appword = Nothing
DoCmd.Close
When I use this though, I get an error message telling me Object Required.
Does anyone know how I can get my program to exit my program? I'm not very familiar with this type of coding.
Thank you,
Garry
Dim appword As Word.Application, strdoc As String
Set appword = CreateObject("Word.Application"
appword.Visible = True
strdoc = "c:\Report\TOC2.doc"
appword.Documents.Open (strdoc)
Set appword = Nothing
I use the following code to quit..
appword.Quit
Set appword = Nothing
DoCmd.Close
When I use this though, I get an error message telling me Object Required.
Does anyone know how I can get my program to exit my program? I'm not very familiar with this type of coding.
Thank you,
Garry