Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VS2010 Excel automation - Hozizontal Alignment
Message
From
13/08/2013 16:58:48
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
VS2010 Excel automation - Hozizontal Alignment
Environment versions
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01580431
Message ID:
01580431
Views:
25
  Excel.Range selectedRange = (Excel.Range)objApp.Selection;
        selectedRange.Columns.AutoFit();
        selectedRange.HorizontalAlignment = HorizontalAlignment.Center;
In the above code, AutoFit works, but Horizontal Alignment doesn't.
  Excel.Range TitleRange = (Excel.Range)xlWorkSheet.get_Range("A3", "M3");
      TitleRange.Style.HorizontalAlignment = HorizontalAlignment.Center;
I tried this..it doesn't work either

I want to enter the text in cells A3-M3.
Any ideas?
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Reply
Map
View

Click here to load this message in the networking platform