02-25-2015 01:15 PM
I'm using ActiveX to copy a block from an existing Excel spreadsheet into a new Excel spreadsheet. When I paste the block into the new spreadsheet, along with the data, I get the formatting (borders, shading etc.) that was used in the original file. However, what I find, is that the column widhts in the new spreadsheeet stay at their default settings. When I copy the block, I us a range of row/column designators; e.g. A1:E10. When I paste the block into the new spreadsheet, I just refer to the upper left cell; e.g. A1. How do I make the column widths in the new spreadsheet the same as the original spreadsheet? I'm familiar with using a template when using the Report Generation Toolkit. Is there a similar technique with ActiveX?
02-25-2015 02:22 PM
@AT1 wrote:
I'm using ActiveX to copy a block from an existing Excel spreadsheet into a new Excel spreadsheet. When I paste the block into the new spreadsheet, along with the data, I get the formatting (borders, shading etc.) that was used in the original file. However, what I find, is that the column widhts in the new spreadsheeet stay at their default settings. When I copy the block, I us a range of row/column designators; e.g. A1:E10. When I paste the block into the new spreadsheet, I just refer to the upper left cell; e.g. A1. How do I make the column widths in the new spreadsheet the same as the original spreadsheet? I'm familiar with using a template when using the Report Generation Toolkit. Is there a similar technique with ActiveX?
If the range columns are of the same width use the Range.ColumnWidth property. When you copy to the new sheet use the row/column designators A1:E10 and set this range column width property to the value of the source worksheet.
Ben64
02-25-2015 04:16 PM
No - columns will be various widths. Guess I'll have to address each column separately.