Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel to Word : Paste specialPaste Link Excel Chart Obj doesn't | Charts and Charting in Excel | |||
EXCEL chart into Word document | Excel Discussion (Misc queries) | |||
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. | Links and Linking in Excel | |||
How do I paste a Word document into an Excel cell | Excel Discussion (Misc queries) | |||
Is there an easy way to take data from a spread sheet and have it entered into a Word document? | New Users to Excel |