View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Carlos Carlos is offline
external usenet poster
 
Posts: 84
Default Formatting Word Tables

Hi,

I am currently working with Excel and Word and the task I need to perform is
pasting a table from Excel to Word. The steps I follow a

- Select an Excel range (xlRng)
- Create an instance of Word (wdApp)
- Add a Word document (doc)
- Paste xlRng into doc using the PasteExcelTable command.
- Set the table as a Word table object (tbl)

Everything is OK until I try to change the width of tbl's columns. Visual
Basic sends me error messages, but they do not apply since the instructions
are Ok. The error messages I receive a

a) 5992: An attempt to modify the width of a column when tbl contains merged
cells. This error appears BEFORE I merge the cells.
b) -2147467259 (80004005): An attempt to change the space between the
paragraphs of tbl. Like in:
With tbl.Range.ParagraphFormat
.SpaceBefore = 0
.SpaceAfter = 0
End With

I am very confused since the number of tables has an influence on whether
Visual Basic raises an error or not. In particular, it sends me this error
messages whenever I paste 6 or more tables. If I use less than 6, the code
runs Ok. If I use more the code stops at table 6.

How do I know if this is a "bug" and how do I report it? I am using MSO
Professional 2003.
--
Carlos