Solved

Paste Excel Table to Word bookmark

Posted on 2011-09-28
4
389 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 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