Solved

Can I control the column width during export to Excel?

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

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…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

735 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