Can I control the column width during export to Excel?
Posted on 2007-11-16
You helped me some time ago to develop some Script to export the contents of a Notes database to Microsoft Excel.
I don't think posting the whole scripts here would help, although i can if needed. I have Agents to do the export, and in their Initialise routine I have something like this:
Set xlApp = CreateObject("Excel.Application")
and later code like this:
xlSheet.Range("D" & 1).Value ="Help documents for HS3 management database", and
xlsheet.Name = "Results"
The agent then runs through all the documents exporting the fields in each document to populate the sheet. This works fine but I'm trying to make some updates and wonder if I can control the column widths to make the output neater other than changing the Excel template that I've used for this.
I'm wondering if there's a command to control the column width when it's setting up the sheet? As a guess, maybe
xlSheet.Range("D").Width =50??? (This guess fails)