G
Graham944
I have written a macro running on MS Project 2000 to write to a Word 2000
document running on Windows NT4. The macro works well except that it often (
but not always)fails if an attempt is made to rerun it. To clear the problem
I have to open the document in Word and then close it.
The essential lines of the macro are
Sub WordLinkTest()
Dim wdDocument As Word.Document
'open the Word document
Set wdDocument = GetObject("c:/WordLinkTest.doc")
'clear the document
wdDocument.Select
wdDocument.Application.Selection.Cut
'create the table
wdDocument.Tables.Add Range:=wdDocument.Application.Selection.Range,
NumRows:=1, NumColumns:=7
'set the column width
wdDocument.Tables(1).Columns(1).PreferredWidthType =
wdPreferredWidthPoints
wdDocument.Tables(1).Columns(1).PreferredWidth = _
CentimetersToPoints(1.2) 'FAILS ON THIS LINE
' with error 462
' "The remote server machine
does not exist or is unavailable"
wdDocument.Close savechanges:=True
Set wdDocument = Nothing
End Sub
Any ideas please,
Graham
document running on Windows NT4. The macro works well except that it often (
but not always)fails if an attempt is made to rerun it. To clear the problem
I have to open the document in Word and then close it.
The essential lines of the macro are
Sub WordLinkTest()
Dim wdDocument As Word.Document
'open the Word document
Set wdDocument = GetObject("c:/WordLinkTest.doc")
'clear the document
wdDocument.Select
wdDocument.Application.Selection.Cut
'create the table
wdDocument.Tables.Add Range:=wdDocument.Application.Selection.Range,
NumRows:=1, NumColumns:=7
'set the column width
wdDocument.Tables(1).Columns(1).PreferredWidthType =
wdPreferredWidthPoints
wdDocument.Tables(1).Columns(1).PreferredWidth = _
CentimetersToPoints(1.2) 'FAILS ON THIS LINE
' with error 462
' "The remote server machine
does not exist or is unavailable"
wdDocument.Close savechanges:=True
Set wdDocument = Nothing
End Sub
Any ideas please,
Graham