Connect with Facebook Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C# Programming

C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-2008, 10:20 AM
Xystus777's Avatar   
Learning Programmer
 
Join Date: Oct 2008
Location: Chesterfield, MI
Age: 18
Posts: 59
Rep Power: 0
Xystus777 is an unknown quantity at this point
Send a message via AIM to Xystus777 Send a message via MSN to Xystus777 Send a message via Skype™ to Xystus777
Question Autofit & Center Excel

Hello everyone,

I'm having some excel issues. I don't want to have to "specify" a range.

Right now, my range is "A1" to "Z500". This is because I want to autofit my columns and center the text like shown:

Code:
//Center the text in Excel 
                    xlWS.get_Range("A1", "Z500").VerticalAlignment = Excel.XlVAlign.xlVAlignCenter; 
                    xlWS.get_Range("A1", "Z500").HorizontalAlignment = Excel.XlVAlign.xlVAlignCenter; 
 
                    //Autofit the columns in Excel 
                    xlRng = xlWS.get_Range("A1", "Z500"); 
                    xlRng.EntireColumn.AutoFit();


Is there a way to center the text and autofit the entire Excel document, without specifying a certain range?
And is it possible to auto detect a range so that I don't have to set it ahead of time. The Excel document that the user loads up may vary in UsedRange. Is there way to find that out? Sorry for so many questions. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
More Excel Stuff (Detailed) Xystus777 C# Programming 0 11-21-2008 12:57 PM
using VB with excel renoald Visual Basic Programming 26 10-20-2008 11:52 AM
MCSE Boot Camp Certification Center Announces Major Website Updates butidonot C and C++ 1 09-24-2008 09:26 AM
MCSE Boot Camp Certification Center Announces Major Website Updates butidonot General Programming 4 09-14-2008 02:03 PM
export to excel problem with IPAddress in URL but working with localhost url mustaque ASP, ASP.NET and Coldfusion 5 08-04-2008 07:31 AM


All times are GMT -5. The time now is 09:22 PM.

Freelance Jobs

XML/XSL: Need code for Book with Chapers using XML
Create an XML file for a book of your creation, and a basic CSS file that will format it to display ...
Earn: $40.00


C++/C: Simple firework cue sequencer
What I require is a rework of a simple cue sequencer. I have a piece of hardware (an Arduino boar...
Earn: $50.00


HTML/XHTML: Menu Rework - ASCIIBin
I'm placing this in the HTML/XHTML section of the Freelance site but you are not limited to HTML. Wh...
Earn: $20.00



CodeCall Goal

Goal #1: 1,000 Blogs
Goal #2: 1,000 Wiki Pages
Goal #3: 300,000 Posts
Goal #4: 20,000 Threads
Done: 30%, 23%, 55%, 75%

Ads