Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Office Spreadsheet 11.0

Status
Not open for further replies.

leonepaolo

Programmer
May 28, 2001
82
CA
Hi,

On an Access form I have a "Microsoft Office Spreadsheet 11.0" control. I'm trying to figure out how to programatically change cell alignment/orientation properties.

Specifically, I want to change a cells Orientation by 90 degrees. As an example of what I mean, when I open an Excel Workbook and select a cell, or a group of cells, I can right click on the spreadsheet, select "Format Cells" from the pop-up menu, click on the "Alignment" tab and at the right of this tab pane I can change the "Orientation" which displays the cell contents on an angle.

Any comments and/or assistance in this regard will be very much appreciated.

Thanks in advance,
Paolo
 
Have a look at the Orientation property of the Range object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

In Excel, Cells(1,1).Orientation = 90 works.

However, using the "Microsoft Office Spreadsheet 11.0" control in Access, this code doesn't work. The error I get is:
Method 'Cells' of object '_Global' failed.

I also tried Range(Cells(1,1)).Orientation = 90, but that didn't work either.

Could I be missing a reference?

Thanks, Paolo
 
I think you have to qualify the Cells object:
yourObject.Cells(1, 1).Orientation = 90

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

Oops on the "yourObject"

I get a Run-time error 438

The ActiveX Control name is SS

When I write to a cell using SS.Cells(1,1) = 90, it works.

However, SS.Cells(1,1).Orientation = 90 does not.

Thanks Again,
Paolo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top