Solved

Can I control the column width during export to Excel?

Posted on 2007-11-16
2
978 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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