?
Solved

Paste Excel Table to Word bookmark

Posted on 2011-09-28
4
Medium Priority
?
399 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
Arno Koster earned 1000 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:Arno Koster
ID: 36891277
0
 

Author Closing Comment

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
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…

801 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