Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JtR JtR is offline
external usenet poster
 
Posts: 1
Default Excel VBA - Easy way to paste chart to word document ?

Sorry i am neewbie with excel macros


Whats is the easyest way to paste chart to word document ? And how t
open word document from excel ?

I all ready have bookmarks in word document and they works fine, but
my macro (excel) copy and other macro in word paste chart how to manag
then starts in order. Mayby i am making something wrong way i think :

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
JtR JtR is offline
external usenet poster
 
Posts: 1
Default Excel VBA - Easy way to paste chart to word document ?

Thanks for reply

I got that to work last night :) My biggest problem was missin
reference to word :)

But now i have new problem i am pasting charts to word in picture mode
but how do i know that picture name in word of chart. Cos i have t
delete that picture next time when i am running excel macro again
Otherwise paste put other one picture that's looks kinda stupid ;

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Excel VBA - Easy way to paste chart to word document ?

For your word referencing problem, try the following code

'Define a Word Document Object
Dim WordDoc as word.document

'Set WordDoc as your word document template
Set WordDoc = WordApp.Documents.Open _
(FileName:=LetTempLoc, ReadOnly:=True)

With these codes everytime when you refer to "WordDoc" you are referring to the word document

You could paste the chart as a link. Though I am not sure about the codes. You can record it to see that it looks like (from Word). A word of cautions though: links from Word to Excel will take long time to load. I have once linked 10 charts from Excel to Word and it took 15 minutes to load.

Instead I create a macro that acts like a mail merge and place charts, delete paragraphs, put in names and other information required on the document. Every time when I need to update, I just rerun the macro to recreate the whole word document. It takes seconds. I have produced hundreds of letters with attached charts that way.

"JtR " wrote:

Thanks for reply

I got that to work last night :) My biggest problem was missing
reference to word :)

But now i have new problem i am pasting charts to word in picture mode,
but how do i know that picture name in word of chart. Cos i have to
delete that picture next time when i am running excel macro again.
Otherwise paste put other one picture that's looks kinda stupid ;)


---
Message posted from http://www.ExcelForum.com/


  #4   Report Post  
Posted to microsoft.public.excel.programming
JtR JtR is offline
external usenet poster
 
Posts: 1
Default Excel VBA - Easy way to paste chart to word document ?

Thanks again for information

I have working macro now what pastes chart's to document.

But that document has multiple editors (users, macros), so i cant d
allways new document cos there is text what change by users. Any ide
to work with this ?


Example what type document i have:

text (users update text)

chartpicture (my macro puts this)
text (users update text)
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Excel VBA - Easy way to paste chart to word document ?

Is there a reason why you need a macro to do this? I normally let the stake holders make the changes before using the macro to create the final mass production. If they have any additional changes, I would let them change the word document template and inform them not to change anything that could affect the workings of my macro (I made all the flags in blue text). I then reran the macros with the revised template. That also works on the changes to the values of the tables since the macro is only a tools that copy and paste from one medium to another.

"JtR " wrote:

Thanks again for information

I have working macro now what pastes chart's to document.

But that document has multiple editors (users, macros), so i cant do
allways new document cos there is text what change by users. Any idea
to work with this ?


Example what type document i have:

text (users update text)

chartpicture (my macro puts this)
text (users update text)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Excel VBA - Easy way to paste chart to word document ?

If you paste the chart at a bookmark in Word, you can go back to the
bookmark, and delete the chart:

Paste at the bookmark:

' Go to bookmark "chart1"
WDApp.Selection.GoTo What:=wdGoToBookmark, Name:="chart1"

' Paste chart at cursor position
WDApp.Selection.PasteSpecial Link:=False, _
DataType:=wdPasteMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

Delete the chart at the bookmark:

' Go to bookmark "chart1"
WDApp.Selection.GoTo What:=wdGoToBookmark, Name:="chart1"

' Extend selection one character right to select the shape
WDApp.Selection.MoveRight Unit:=wdCharacter, Count:=1, _
Extend:=wdExtend
WDApp.Selection.Delete

I wish I understood better how it worked, but Word's object model always
gives me a headache.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

JtR < wrote:

Thanks again for information

I have working macro now what pastes chart's to document.

But that document has multiple editors (users, macros), so i cant do
allways new document cos there is text what change by users. Any idea
to work with this ?


Example what type document i have:

text (users update text)

chartpicture (my macro puts this)
text (users update text)


  #7   Report Post  
Posted to microsoft.public.excel.programming
JtR JtR is offline
external usenet poster
 
Posts: 1
Default Excel VBA - Easy way to paste chart to word document ?

Thanks for reply's

Jon Peltier that delete think work fine thanks. I manage to finish m
little macro :

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to Word : Paste specialPaste Link Excel Chart Obj doesn't Makedon Charts and Charting in Excel 0 January 12th 10 08:56 PM
EXCEL chart into Word document Perplexed Excel Discussion (Misc queries) 0 December 9th 07 09:51 PM
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. tln Links and Linking in Excel 0 April 22nd 07 04:28 PM
How do I paste a Word document into an Excel cell callawayx18 Excel Discussion (Misc queries) 0 January 10th 07 10:46 PM
Is there an easy way to take data from a spread sheet and have it entered into a Word document? Marc New Users to Excel 2 April 8th 05 10:53 PM


All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"