View Single Post
 
Old 07-23-2011, 01:46 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Joe,

Instead of 'ConfirmCoversions = False' you should have 'ConfirmCoversions:=False'. Your code could also be made more efficient:
Code:
Sub PopulateWord()
Dim appWD As Word.Application
Set appWD = CreateObject("Word.Application")
With Sheets("By Event Name")
  If Range("B2").Value = "" Then
    Range("A1", Range("A1").End(xlToRight)).Copy
  Else
    Range("A1", Range("A1").End(xlToRight).End(xlDown)).Copy
  End If
End With
With appWD
  .DisplayAlerts = False
  .Documents.Open FileName:="U:\TPCentral_Too\Templates\PD_HO_Announcement\PD_ HO_Announcement2.htm", ConfirmCoversions:=False
  With .ActiveDocument
    .Range.Delete
    .Range.Paste
    .Close SaveChanges:=True
  End With
  .DisplayAlerts = True
  .Quit
End With
End Sub
Note: When posting code, please use code tags.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 07-24-2011 at 04:35 PM.
Reply With Quote