Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2013, 06:45 AM
q_scribe q_scribe is offline PasteAppendTable not available (Run-Time Error 4605) Windows 7 64bit PasteAppendTable not available (Run-Time Error 4605) Office 2010 32bit
Novice
PasteAppendTable not available (Run-Time Error 4605)
 
Join Date: Jul 2013
Posts: 2
q_scribe is on a distinguished road
Question PasteAppendTable not available (Run-Time Error 4605)

I am writing a macro in Word that will copy a large range from an Excel document and paste it into an existing table in the Word document. The macro places the cursor in the table, opens the the specified Excel document, copies the range, and closes the Excel document, leaving the data on the clipboard. As soon as the document closes, Word throws Run-Time Error 4605, "Command not available," on the line where I attempt to paste the range.



Here's the code:

Code:
Dim XLApp As Object
Dim XLDoc As Object
Dim WDApp As Object
Dim filepath As String
filepath = InputBox("Enter the filepath of the spreadsheet:", "Enter filepath", "C:\")
Set XLApp = CreateObject("Excel.Application")
Set WDApp = Word.Application
XLApp.Visible = True
XLApp.Workbooks.Open filepath
'Copy data range (ending cell is an arbitrary large number)
XLApp.CutCopyMode = True
XLApp.ActiveWorkbook.Worksheets(1).Range("A2:G650").Select
XLApp.Selection.Copy
XLApp.ActiveWorkbook.Close
XLApp.Application.Quit
'Paste the range, merging with the existing table
With WDApp
    Selection.PasteAppendTable '*****Error thrown here
End With
I have tried replacing the contents of the With WDApp block with the following code, attempting to access the clipboard:
Code:
Dim MyData As MSForms.DataObject  
Dim strClip As Variant
Set MyData = New MSForms.DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
strClip.PasteAppendTable
But this code throws the same error on the line strClip.PasteAppendTable.

When I end the code (after the error), "append table" does appear as a special paste option on the Ribbon button. I'm not sure why VBA can't find the command. Any help/advice/insight is greatly appreciated.
Reply With Quote
  #2  
Old 08-12-2013, 09:56 AM
q_scribe q_scribe is offline PasteAppendTable not available (Run-Time Error 4605) Windows 7 64bit PasteAppendTable not available (Run-Time Error 4605) Office 2010 32bit
Novice
PasteAppendTable not available (Run-Time Error 4605)
 
Join Date: Jul 2013
Posts: 2
q_scribe is on a distinguished road
Default

(Bump) Anyone? Any additional information I can provide? This is the last week I have to work on this problem, so any help would be greatly appreciated.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PasteAppendTable not available (Run-Time Error 4605) PasteAppendTable Question danenorman13 Word VBA 2 05-24-2013 04:55 PM
Get Run-time Error 11 Jamtart PowerPoint 2 08-31-2012 05:04 AM
PasteAppendTable not available (Run-Time Error 4605) Run time error 1004 yonasan Excel Programming 3 06-12-2012 11:08 PM
Word Visual Basic error - run time error 504 crazymorton Word 11 01-13-2012 04:32 AM
PasteAppendTable not available (Run-Time Error 4605) Run-time error 438 cksm4 Word 2 01-12-2011 03:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft