Avatar of CRISIL
CRISIL

asked on 

How to insert selected excel data along with chart into word document

How to insert selected excel data along with chart into word document

Visual Basic.NETC#Microsoft Excel

Avatar of undefined
Last Comment
theGhost_k8
Avatar of Sajithcgs
Sajithcgs

you had posted in wrong place well
you can do the following for exporting

Open the worksheet in Excel
Select the cells to be embedded
Click the Copy toolbar button
Switch to the Word document
Click the insertion point where you want the worksheet to be
Click Edit, Paste Special, and select Microsoft Excel Worksheet Object
Avatar of theGhost_k8
theGhost_k8
Flag of India image

i don't think its in wrong place, sajithcgs....

it is possible .... this shows how to manually select and copy paste.
you have to add word and excel dlls  that u must be knowing....

1. Create a Word Document:

    Dim oApp As Word.Application
    Dim oDoc As Word.Document

    'Start a new document in Word
    Set oApp = CreateObject("Word.Application")
    Set oDoc = oApp.Documents.Add

2. a. Copy Excel selection:

    Range("A26").Select
    Selection.Copy
   
    b. Copy Excel chart:

    ActiveSheet.ChartObjects("Chart 1").Activate
    ActiveChart.ChartArea.Select
    ActiveChart.ChartArea.Copy

    c. Paste Excel selection into Word:

    Selection.PasteExcelTable False, False, False

    d. Paste Excel chart into Word:

    Selection.PasteAndFormat (wdChartPicture)

let me know ...
ASKER CERTIFIED SOLUTION
Avatar of theGhost_k8
theGhost_k8
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo