Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Archive: Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications > Archive: Business Applications >
Solved: Embedding an edited excel sheet in word.

Reply  
Thread Tools
ranon's Avatar
Junior Member with 6 posts.
 
Join Date: Jan 2005
Experience: Intermediate
22-Sep-2008, 09:28 AM #1
Solved: Embedding an edited excel sheet in word.
I need to embed an excel sheet into word quite regularly. It looks like the sample document given. Generally only the price changes but the formulas remain the same.

Is there some word macro that can accomplish this?
Attached Files
File Type: zip price_table.zip (13.7 KB, 18 views)
bomb #21's Avatar
Distinguished Member with 8,082 posts.
 
Join Date: Jul 2005
Location: The void AKA edge of the Fens
Experience: I bent my wookie :(
22-Sep-2008, 09:50 AM #2
Have you tried Paste Link?

Copy your range in Excel. Switch to Word, then Edit > Paste Special. For "As", highlight Excel Worksheet Object, and select Paste Link. You should see info that says "changes to the source will be reflected in your document", so ... "auto-updating".

Welcome to the board.
__________________
"Love All The People."
Bill Hicks, 1961 - 1994 -- R.I.P.
ranon's Avatar
Junior Member with 6 posts.
 
Join Date: Jan 2005
Experience: Intermediate
22-Sep-2008, 10:54 AM #3
Yes, that would work.

A macro to copy - paste would make the job a lot easier. I could use some help on that.
bomb #21's Avatar
Distinguished Member with 8,082 posts.
 
Join Date: Jul 2005
Location: The void AKA edge of the Fens
Experience: I bent my wookie :(
22-Sep-2008, 11:01 AM #4
Quote:
Originally Posted by ranon
Yes, that would work.

A macro to copy - paste would make the job a lot easier. I could use some help on that.
Since the table in your doc is dynamically linked to the source (table in Excel), I don't see how.

Is there some other info you've not shared? (such as data in Excel may vary in size or has a variable location)
ranon's Avatar
Junior Member with 6 posts.
 
Join Date: Jan 2005
Experience: Intermediate
22-Sep-2008, 11:16 AM #5
Quote:
Originally Posted by bomb #21 View Post
Since the table in your doc is dynamically linked to the source (table in Excel), I don't see how.
Its not dynamically linked. An embedded copy paste (static) is what I want. After pasting each word document will change the prices and other minor formatting as required.
ranon's Avatar
Junior Member with 6 posts.
 
Join Date: Jan 2005
Experience: Intermediate
22-Sep-2008, 11:17 AM #6
The data in Excel has a fixed location and a range to copy from.

(This is basically a sheet that I create myself for convenience)
bomb #21's Avatar
Distinguished Member with 8,082 posts.
 
Join Date: Jul 2005
Location: The void AKA edge of the Fens
Experience: I bent my wookie :(
22-Sep-2008, 11:54 AM #7
Yeah, I do understand what you're saying (now), but I'm struggling for a best method.

What I like the look of is ... a "template" doc (not an actual template) with the table in, and a bookmark defined for the table.

Then you can use Insert > File, and specify the bookmark (say "Table") as the range to insert. That way, the source doc needn't be opened at any time.

That translates as a fairly simple Word macro:

Sub test()
Selection.InsertFile FileName:="test.doc", Range:="table", _
ConfirmConversions:=False, Link:=False, Attachment:=False
End Sub


although, you might need to define the path to test.doc if its directory doesn't match your current doc.

Let me test it some more.
__________________
"Love All The People."
Bill Hicks, 1961 - 1994 -- R.I.P.
bomb #21's Avatar
Distinguished Member with 8,082 posts.
 
Join Date: Jul 2005
Location: The void AKA edge of the Fens
Experience: I bent my wookie :(
22-Sep-2008, 12:03 PM #8
This seems to work:

Sub test()
ChangeFileOpenDirectory "C:\Documents and Settings\Andy\My Documents\"
Selection.InsertFile FileName:="test.doc", Range:="table", _
ConfirmConversions:=False, Link:=False, Attachment:=False
End Sub


You'd need to insert it in an added module under Project - Normal in the Word VBE*. Do you know how to do that?

*after which you could probably assign it to a toolbar button.
__________________
"Love All The People."
Bill Hicks, 1961 - 1994 -- R.I.P.
ranon's Avatar
Junior Member with 6 posts.
 
Join Date: Jan 2005
Experience: Intermediate
22-Sep-2008, 12:24 PM #9
I tested it out. It works.

I added it as a macro in the normal template. I will give it a shortcut key, maybe add it to the ribbon.

Thanks a million. This will save me a lot of work. I am already going to tweak it a little, e.g. have 2-3 macros for different flavors of tables. Thanks again.
bomb #21's Avatar
Distinguished Member with 8,082 posts.
 
Join Date: Jul 2005
Location: The void AKA edge of the Fens
Experience: I bent my wookie :(
22-Sep-2008, 12:34 PM #10
Quote:
Originally Posted by ranon
I tested it out. It works.

I added it as a macro in the normal template. I will give it a shortcut key, maybe add it to the ribbon.

Thanks a million. This will save me a lot of work. I am already going to tweak it a little, e.g. have 2-3 macros for different flavors of tables. Thanks again.


I'm sure you realise that you could store the different tables in a single "template" doc, so long as each one has its own bookmark for the macros to identify.

Use Thread Tools at the top of the page to mark this Solved if you wish.
ranon's Avatar
Junior Member with 6 posts.
 
Join Date: Jan 2005
Experience: Intermediate
22-Sep-2008, 12:47 PM #11
Quote:
Originally Posted by bomb #21 View Post


I'm sure you realise that you could store the different tables in a single "template" doc, so long as each one has its own bookmark for the macros to identify.
That was the idea. It's a nice, clean solution.
Reply

Tags
excel 2007, word 2007

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:08 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.