Hello, I don't use vba for Word too often, but I have a need to manipulate some Word tables from excel.
I'm basically trying to distribute columns widths except for the first column.
I first got it working in Word and then attempting it from excel.
In Word I first had:
But this distributed the width of the entire table when I wanted to exclude the first column.
So playing around I changed it to:
Which works. But why I don't understand. If I select mycells and modify the selection the same thing should happen if I modify mycells directly, shouldn't it?
But I thought no matter I have it working.
But when I try selection.cells.distributewidth in excel I get an error object doesn't support this property or method. In excel I'm not using activedocument, I'm defining the document
And the above range manipulation is within a With wdDoc .... end with.
I believe the selection is failing because it's referencing the excel workbook instead of word (even though I wouldn't have thought it would when it's in a With wdDoc. So that's one problem.
But the problem would be avoided if mycells.cells.distributewidth worked. Any idea why it wouldn't?
Bookmarks