Solved

Paste Excel Table to Word bookmark

Posted on 2011-09-28
4
373 Views
Last Modified: 2012-05-12
I am trying to automate (vie VBA) copying some Excel tables into a Word document at specific bookmarked locations. The following is a code snippet:

    'this should copy the Excel table to the clipboard
     Range(strRangeName).Copy    

     'this should paste the  clipboard into the word document
     wrdrngBookMark.PasteAndFormat Type:=wdFormatOriginalFormatting  

I am successfully copying charts across with the folowing:
            ActiveChart.ChartArea.Copy
            wrdrngBookMark.PasteAndFormat Type:=wdChartPicture

Please what am I doing wrong with the tables??
0
Comment
Question by:NormanMitchell
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
akoster earned 500 total points
ID: 36717582
you should be able to  use

wrdrngBookMark.PasteExcelTable False, False, False
0
 

Author Comment

by:NormanMitchell
ID: 36890520
This solution only worked a couple of times (out of many tries). PasteSpecial appears to work all the time.

Any ideas why PasteExcelTable is unreliable?
0
 
LVL 19

Expert Comment

by:akoster
ID: 36891277
0
 

Author Closing Comment

by:NormanMitchell
ID: 36909964
The solution did not work consistently
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now