出现"实时错误462远程服务器不存在或不能使用"
Sub A(ByVal fileFolder As String)
Dim app As New Word.Application
Set app = New Word.Application
Dim doc As Word.Document
app.Visible = True
Set doc = app.Documents.Open(fileFolder & FileName) '打开文件
Dim str As String
Dim myRange1 As Word.Range
Set myRange1 = ActiveDocument.Range(Start:=0, End:=ActiveDocument.Words(1).End)
str = myRange1.Text
MsgBox str
doc.Close savechanges:=wdDoNotSaveChanges
app.Quit
Set app = Nothing
End Sub
我两次连续调用此过程,参数分别为"D:\test1\" "D:\test2\",调用第一个没有问题,第二个出现"实时错误462远程服务器不存在或不能使用" ,我点调试光标在Set myRange1 = ActiveDocument.Range(Start:=0, End:=ActiveDocument.Words(1).End)一行,我想应该是ActiveDocument还是上次,没有关闭,但怎么解决呢