![]() |
|
#6
|
||||
|
||||
|
Hi Tinfanide,
The line: Dim AppWord As Word.Application is only relevant if you've already set a reference to Word. Try: Code:
Private Sub CopyToWord()
Dim arr As Variant, x As Long, AppWord As Object
Set AppWord = CreateObject("Word.Application")
arr = Array("A", "B", "C")
With ActiveSheet
.Cells.Clear
For x = 1 To 3
.Range(arr(x - 1) & "1").Value = x
Next x
.Range("A1:C1").Copy
End With
With AppWord
.Visible = True
.Documents.Add
With .ActiveDocument
.Range.Paste
.Tables(1).Delete
'.Close SaveChanges:=False
End With
'.Quit
End With
Set AppWord = Nothing
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple VBA macro error | Formulayeti | PowerPoint | 1 | 12-09-2011 10:02 PM |
Runtime Error 4120 in Word 2007 macro
|
Frankwlc | Word | 5 | 11-28-2011 01:54 AM |
Works to word
|
Janette | Word | 1 | 11-12-2011 08:23 AM |
| Macro Error 5174 | muster36 | Word VBA | 0 | 08-12-2011 03:34 AM |
| Converting from Works | Menno Hershberger | Office | 0 | 09-01-2010 11:33 PM |