LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with OWC11 cells alignment from C#


Hi,

I'm not sure if it's the proper forum to ask that but I haven't see
any more suitable.

I'm trying to use the Office 2003 Web Components into a C# applicatio
to display a simple report in a form. I added the COM spreadshee
object to the project an included it in a test form. Then I'm trying t
display the report in the spreadsheet.

The problem I currently have is, I've found no way to set th
horizontal alignment of a cell. When trying to use th
HorizontalAlignment property of the SpreadSheet.ActiveCell
SpreadSheet.Selection or Range objects, the compiler says me:
"D:\desarrollo\C#\Gespubli\Formularios\TestForm.cs (46): The languag
doesn't admit the property, the indexer or the even
'HorizontalAlignment'; try to call directly the methods with acces
descriptor 'OWC11._Range.get_HorizontalAlignment()'
'OWC11._Range.set_HorizontalAlignment(OWC11.XlHAli gn)'"

The problem is, this methods doesn't exist... so I can't use them!

I have similar problems with cell colors, font properties, etc.

Can anybody give me a hint?

Here's the code:


Code
-------------------

// Get first worksheet
OWC11.Worksheetws = (OWC11.Worksheet)axSpreadsheet1.Worksheets[1];
// Set worksheet name
ws.Name = "Reportes";
// Get some cells from the first line
range = (OWC11.Range)ws.get_Range("A1","E1");
// Merge the cells
range.Merge(ref btmp);
// Select the merged cell
range.Select();
// Set the cell text
axSpreadsheet1.ActiveCell.set_Value(System.Type.Mi ssing,"REGIONAL");
// Until here all works ok. But that doesn't work:
axSpreadsheet1.ActiveCell.HorizontalAlignment = OWC11.XlHAlign.xlHAlignCenter;

-------------------

--
Urotsukidoj
-----------------------------------------------------------------------
Urotsukidoji's Profile: http://www.officehelp.in/member.php?userid=515
View this thread: http://www.officehelp.in/showthread.php?t=126378

Posted from - http://www.officehelp.i

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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
Alignment problem with spreadsheet Jorge Cervantes New Users to Excel 4 September 18th 09 07:23 PM
In Cell alignment, how do I update the default vertical alignment How to update default cell alignment Setting up and Configuration of Excel 2 February 4th 09 02:25 PM
vertical text alignment problem when printing BobD2400 Excel Discussion (Misc queries) 1 January 20th 07 05:07 AM
Command Button Alignment Problem zabo21 Excel Programming 2 August 1st 05 04:26 PM
Text format alignment problem Steve Excel Programming 3 November 27th 03 02:32 PM


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"