I Need Help ! Quit a word application and a Close word doc

T

Tom Smith

It looks like you should be posting to
microsoft.public.word.vba.beginners

TomS

In the code above Im opening a word document, But when I try to close the Document and the Application of word, I have 2 errors. With this error I cant compile Please help me I need this

Errors
1-'Quit' is ambiguous across the inherited interfaces 'Word._Application' and 'Word.ApplicationEvents4_Event'.

2- 'close' is ambiguous across the inherited interfaces 'Word._Document' and 'Word.DocumentEvents2_Event'.

Dim wrd As New Word.Application()
Dim docu As Word.Document
wrd.Visible = Visible
wrd.ScreenUpdating = False

'Open the document
docu = wrd.Documents.Open("c:\worddoc1.doc")

'Here comes the error
docu.Close()
wrd.Quit()
doc = Nothing
wrd = Nothing
 
H

http://www.visual-basic-data-mining.net/forum

In the code above Im opening a word document, But when I try to close the Document and the Application of word, I have 2 errors. With this error I cant compile Please help me I need this

Errors
1-'Quit' is ambiguous across the inherited interfaces 'Word._Application' and 'Word.ApplicationEvents4_Event'.

2- 'close' is ambiguous across the inherited interfaces 'Word._Document' and 'Word.DocumentEvents2_Event'.

Dim wrd As New Word.Application()
Dim docu As Word.Document
wrd.Visible = Visible
wrd.ScreenUpdating = False

'Open the document
docu = wrd.Documents.Open("c:\worddoc1.doc")

'Here comes the error
docu.Close()
wrd.Quit()
doc = Nothing
wrd = Nothing
 
H

http://www.visual-basic-data-mining.net/forum

Thanks Smith,

I will post their. Hopefully someone can help.:)

--
forum member
http://www.visual-basic-data-mining.net/forum


It looks like you should be posting to
microsoft.public.word.vba.beginners

TomS

In the code above Im opening a word document, But when I try to close the Document and the Application of word, I have 2 errors. With this error I cant compile Please help me I need this

Errors
1-'Quit' is ambiguous across the inherited interfaces 'Word._Application' and 'Word.ApplicationEvents4_Event'.

2- 'close' is ambiguous across the inherited interfaces 'Word._Document' and 'Word.DocumentEvents2_Event'.

Dim wrd As New Word.Application()
Dim docu As Word.Document
wrd.Visible = Visible
wrd.ScreenUpdating = False

'Open the document
docu = wrd.Documents.Open("c:\worddoc1.doc")

'Here comes the error
docu.Close()
wrd.Quit()
doc = Nothing
wrd = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top