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

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
danielolorenzAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
unknown_routineConnect With a Mentor Commented:
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
All Courses

From novice to tech pro — start learning today.