Solved

Can I control the column width during export to Excel?

Posted on 2007-11-16
2
972 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
Comment Utility
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
Comment Utility
Excellent, thanks!
Stuart
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

14 Experts available now in Live!

Get 1:1 Help Now