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.
<akh2103[ at ]gmail.com> wrote in message news:1152737144.068844.218820[ at ]h48g2000cwc.googlegroups.com...
[Quoted Text] > 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 >
|