?
Solved

Can I control the column width during export to Excel?

Posted on 2007-11-16
2
Medium Priority
?
990 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 63

Accepted Solution

by:
SysExpert earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
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 will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 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