A
Andrew
Hi, friends,
When running the following code, I got an error at line msdoc.Close (see
code below)
Run-time error -2147417851(80010105)
Dim mswd As New Word.Application
Dim msdoc As Word.Document
Set msdoc = mswd.Documents.Open("c:\templateHF.doc")
msdoc.Range.InsertFile "c:\CQInfo.doc"
msdoc.Close
mswd.Quit
As a result, could not open file TemplateHF.doc anymore. It said this file is
locked for editing.
(If before msdoc.Close, I add: msdoc.SaveAs "c:\new.doc", this new.doc is
locked for edition too).
Any ideas? Thanks.
When running the following code, I got an error at line msdoc.Close (see
code below)
Run-time error -2147417851(80010105)
Dim mswd As New Word.Application
Dim msdoc As Word.Document
Set msdoc = mswd.Documents.Open("c:\templateHF.doc")
msdoc.Range.InsertFile "c:\CQInfo.doc"
msdoc.Close
mswd.Quit
As a result, could not open file TemplateHF.doc anymore. It said this file is
locked for editing.
(If before msdoc.Close, I add: msdoc.SaveAs "c:\new.doc", this new.doc is
locked for edition too).
Any ideas? Thanks.