Solved

How Do You Auto-Expand All Columns on an Excel SpreadSheet?

Posted on 2013-11-19
1
633 Views
Last Modified: 2013-11-21
I am opening an Excel SpreadSheet in Visual Studio C#.  I need to know how to auto-expand all Excel SpreadSheet columns on Open.  I currently cannot see all column information.

Thanks,

Dan
0
Comment
Question by:danielolorenz
1 Comment
 
LVL 15

Accepted Solution

by:
unknown_routine earned 500 total points
ID: 39659582
I assume you already know how to open an Excel application and worksheet in C#.


If so all you need is :

 Cells.EntireColumn.AutoFit

Cells is a property of the worksheet.

so after opening the Excel application simply run the above code.

MyWorkSheet.Cells.EntireColumn.AutoFit


If this is not clear enough please let me know.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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