Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
[email protected] akh2103@gmail.com is offline
external usenet poster
 
Posts: 1
Default Macro for word tables to excel

There are lots of posts asking how to write a macro exporting a word
table to excel 2003. This is probably the most simple macro for this
task:

Sub GetWordTable()

Dim wdap As Word.Application
Dim wddc As Word.Document
Dim wdtbl As Word.Table

Set wdap = GetObject(, "word.application")
Set wddc = wdap.ActiveDocument
Set wdtbl = wddc.Tables(1)

wdtbl.Range.Cut

ActiveSheet.Paste

End Sub

  #2   Report Post  
Posted to microsoft.public.word.tables
Jezebel Jezebel is offline
external usenet poster
 
Posts: 1,384
Default Macro for word tables to excel

Simple to the point of silly. How can you, at the Excel end, know that it's
the first table in the active document that you want? And why remove it
remove the document rather than copying it? You'll also get poor results if
any of the Word cells contains multiple paragraphs.

It's also poor programming to mixing early and late binding.


wrote in message
oups.com...
There are lots of posts asking how to write a macro exporting a word
table to excel 2003. This is probably the most simple macro for this
task:

Sub GetWordTable()

Dim wdap As Word.Application
Dim wddc As Word.Document
Dim wdtbl As Word.Table

Set wdap = GetObject(, "word.application")
Set wddc = wdap.ActiveDocument
Set wdtbl = wddc.Tables(1)

wdtbl.Range.Cut

ActiveSheet.Paste

End Sub



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro execution using MailMerge nelsonj Mailmerge 9 June 13th 06 05:04 PM
Importing tables from Excel Island Girl New Users 3 May 26th 06 09:37 PM
wordcount macro for tables and brackets Nikeel Tables 2 December 30th 05 07:43 PM
Inserting Excel tables into Word Louise Microsoft Word Help 13 November 1st 05 06:56 PM
How stable are tables paste-linked from Excel XP into Word XP Karen163 Microsoft Word Help 1 December 13th 04 10:11 AM


All times are GMT +1. The time now is 08:35 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"