run-time error 5825 - only on one machine...???

E

ebaralt

Hi. I have the following very simple code in a Word2000 macro. It
runs perfectly on almost all machines, but on one particular machine it
comes up the a run-time error 5825: Object has been deleted. After the
macro errors out, the ToC code is there. Has anyone got an idea what
might be happening on this one machine?

With Word.ActiveDocument
If .TablesOfContents.Count > 0 Then
.TablesOfContents.Item(1).Update '* get the error
End If
End With

(or I tried it more explicity:)

Dim toc As TableOfContents
With Word.ActiveDocument
If .TablesOfContents.Count > 0 Then
Set toc = .TablesOfContents(1)
toc.Update '* get the error
End If
End With

Thanks.
Elena
 

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