Solved

Can I control the column width during export to Excel?

Posted on 2007-11-16
2
977 Views
Last Modified: 2013-12-18
Hi experts,

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)

Thanks

Stuart
0
Comment
Question by:StuartOrd
2 Comments
 
LVL 63

Accepted Solution

by:
SysExpert earned 500 total points
ID: 20301305
something like

  xlApp.Columns("A").Select
    xlApp.Selection.ColumnWidth = 13

or

 xlSheet.Columns( 1).Columnwidth = 13
     xlSheet.Columns( 2).Columnwidth = 30
     xlSheet.Columns( 3).Columnwidth = 15

I hope this helps !
0
 

Author Comment

by:StuartOrd
ID: 20301378
Excellent, thanks!
Stuart
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now