Solved

Paste Excel Table to Word bookmark

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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