![]() |
|
#1
|
|||
|
|||
|
The macro runs well but when I press F5 in VB, it always returns "runtime error: 462" when it comes to the saveAs method.
Code:
Private Sub copytoWord_Click()
Dim AppWord As Word.Application
Set AppWord = CreateObject("Word.Application")
AppWord.Visible = True
Sheets("Sheet1").Range("A1:B4").Copy
AppWord.Documents.Add
AppWord.Selection.Paste
Application.CutCopyMode = False
With ActiveDocument
.SaveAs2 "C:\Users\Tin\Desktop\" & "Book1", wdFormatDocumentDefault
End With
Set AppWord = Nothing
End Sub
|
|
|
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 |