S
Squeff
I have an application that builds a nice looking table in Excel. The
end-user wants this to be as Word table, instead.
The spreadsheet has 10 columns (all equal width), although the columns
are merged in some rows.
I have a VBA routine (in Excel) that copies the spreadsheet and pastes
it into Word.
It looks good, but is too wide to fit on the page and it resizes the
columns inappropriately, so I issue this command
appWD.Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow)
to (at least) make it fit on the page. However, this resizes the
columns in a way different than I want them.
I'd like to be able to have my paste use the exact same relative
columns widths as the source.
I've tried
appWD.Selection.Tables(1).Columns.Width = 44.25
but this doesn't work because I have merged cells. I can't specify a
column index, because I then get a message that it can't refer to
specific column indexes because of the merged cells.
The end result has to be a normal Word table, so I can't make it a
graphic. I can't have Excel save as an RTF, because this strips a
good deal of my formatting.
Any ideas of how I can end up with an exact copy of my Excel
spreadsheet as a Word table? All formatting, save for the widths, is
perfect.
end-user wants this to be as Word table, instead.
The spreadsheet has 10 columns (all equal width), although the columns
are merged in some rows.
I have a VBA routine (in Excel) that copies the spreadsheet and pastes
it into Word.
It looks good, but is too wide to fit on the page and it resizes the
columns inappropriately, so I issue this command
appWD.Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow)
to (at least) make it fit on the page. However, this resizes the
columns in a way different than I want them.
I'd like to be able to have my paste use the exact same relative
columns widths as the source.
I've tried
appWD.Selection.Tables(1).Columns.Width = 44.25
but this doesn't work because I have merged cells. I can't specify a
column index, because I then get a message that it can't refer to
specific column indexes because of the merged cells.
The end result has to be a normal Word table, so I can't make it a
graphic. I can't have Excel save as an RTF, because this strips a
good deal of my formatting.
Any ideas of how I can end up with an exact copy of my Excel
spreadsheet as a Word table? All formatting, save for the widths, is
perfect.