Import Data from Excel Table to Word Table- word 2003
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Import Data from Excel Table to Word Table- word 2003
Hi all,
i have some preformatted tables in a word document with some data in it; some people of my project team always send me their updated Data in an excel, where i have always the task to copy the data the right way. As the tables in Excel have the same form in Word: how is it possible via VBA to import the data i want into my word table/tables (as is want). The data exchange out from excel is not as easy as data exchange into excel....
I don´t want to copy the data everytime by hand...
i attached a word file with the tables in it and added the excel file into it, i get per month
your help will be appreciated,
stefan
ps: by the way, hi Hans!!!
i have some preformatted tables in a word document with some data in it; some people of my project team always send me their updated Data in an excel, where i have always the task to copy the data the right way. As the tables in Excel have the same form in Word: how is it possible via VBA to import the data i want into my word table/tables (as is want). The data exchange out from excel is not as easy as data exchange into excel....
I don´t want to copy the data everytime by hand...
i attached a word file with the tables in it and added the excel file into it, i get per month
your help will be appreciated,
stefan
ps: by the way, hi Hans!!!
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
Hi Stefan,
Welcome to Eileen's Lounge!
Do you want to import all the "tables" from the Excel workbook into a Word document?
Do all the tables start with "WHEN"? (I notice that they don't all end the same: some have "From WHOM" in the last row, while others have "Notes")
Welcome to Eileen's Lounge!
Do you want to import all the "tables" from the Excel workbook into a Word document?
Do all the tables start with "WHEN"? (I notice that they don't all end the same: some have "From WHOM" in the last row, while others have "Notes")
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
the structure in excel corresponds to the word table (they are exact copies) - they corespond to their word originals;in the excelfile you have the whole list of the communication matrices in it; in my word doc i only copied one table to show how one table is formatted.
I want to import the data selectively (?). Is this possible??
I want to import the data selectively (?). Is this possible??
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
Does that mean that you'd like to be able to choose from a list? If so, what should the list display? For example, the value from column C in the first row of each "table"?
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
that is correct (if thats not too difficult to get)
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
I'll see what I can come up with.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
The easiest way would be to copy a "table" in the Excel workbook and paste it into the Word document. No code, no hassle.
If you prefer to automate it, see the attached zip file. The Word document contains a macro ImportFromExcel that will open a userform. It'll ask you to select the workbook; it will then populate the list box with the available "tables". Select one and click Import.
Note: you'll have to make sure that the first column of each table is shaded correctly - the code has to find out some way where the table ends, and I chose the shading.
You'll want to clean up the formatting of the imported table, I'll leave that to you.
If you prefer to automate it, see the attached zip file. The Word document contains a macro ImportFromExcel that will open a userform. It'll ask you to select the workbook; it will then populate the list box with the available "tables". Select one and click Import.
Note: you'll have to make sure that the first column of each table is shaded correctly - the code has to find out some way where the table ends, and I chose the shading.
You'll want to clean up the formatting of the imported table, I'll leave that to you.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
may i call it the wow - factor???
k, i´m testing it and play for a while... ;-))
k, i´m testing it and play for a while... ;-))
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
ok, i tried to test it in office 2003 , but it seems, that the macro seems to need an excel 2007 sheet, eh?
it can´t open excel files before office 2007;
it can´t open excel files before office 2007;
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
Change "*.xls?" to "*.xls".
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
ok, but then i get the application or objectoriented error message... might there be a problem with my multilanguage german office?
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
Does this version work better? I used late binding instead of early binding.
If you still get error messages, please try to find out where they arise.
If you still get error messages, please try to find out where they arise.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
ok, now i can decide which table to import, the only thing then happens is the mixture of the tableformat after importing the tables; but this seems to be normal in word.... (one of the reasons, i like excel that much)
cheers,
stefan
cheers,
stefan
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
It's perfectly possible to create good-looking tables in Word, but the tables in the Excel workbook haven't been created with copying to Word in mind...
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
ok, i understand, thanks for your support. ;-)
ps: its that late in the Nederlands right now???
ps: its that late in the Nederlands right now???
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
Sorry, what do you mean?Stefan_Sand wrote:ps: its that late in the Nederlands right now???
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
i meant your shown system time as a joke. ;)
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Import Data from Excel Table to Word Table- word 2003
Do you mean the time beneath my user picture? That's the date and time I joined Eileen's Lounge.
Or did you mean something else?
Or did you mean something else?
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: Import Data from Excel Table to Word Table- word 2003
yes, thats what i meant, overseen in a few moments....