Solved

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

Posted on 2013-11-19
1
680 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
[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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

738 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