Hi to all!
I am working with Excel sheets an could not translate some VB commands.
- To change the row height
Rows("15:15").Select
Selection.RowHeight = 39
- There is a rectangle defined and I need to write on it.
ActiveSheet.Shapes("Rectangle 5").Select
Selection.Characters.Text = "X"
With Selection.Characters(Start:=1, Length:=3).Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
TIA & Regards, Euclides
OleExcel
- gkuhnert
- Posts: 274
- Joined: Fri Apr 04, 2008 1:25 pm
- Location: Aachen - Germany // Kerkrade - Netherlands
- Contact:
Euclides,
maybe you need something like this:
maybe you need something like this:
Code: Select all | Expand
oSheet:Rows("15,16"):Rowheight := 35
oSheet:Rows("11"):Rowheight := 20
oSelect := ActiveSheet.Shapes("Rectangle 5")
oSelect:Characters():Text = "X"
oSelFont:=oSelect:Characters(Start:=1, Length:=3):Font()
oSelFont:Name := "Arial"
oSelFont:FontStyle := "Normal"
Hi Gilbert, thanks for the replay and sorry for the delay
)
1 - I quit using SHAPES.
oSelect:=oSheet:Shapes("Rectangle 5")
gives error
Error 1643324/3 DISP_E_MEMBERNOTFOUND: SHAPES
I will write on the cells. is not so fancy but works.
2 - oSheet:Rows("15"):Rowheight := 35
changes the row height, but:
uVar := oSheet:Rows("15"):Rowheight
always returns "*"
there is a way to check the Height of the Row?
TIA and regards, Euclides

1 - I quit using SHAPES.
oSelect:=oSheet:Shapes("Rectangle 5")
gives error
Error 1643324/3 DISP_E_MEMBERNOTFOUND: SHAPES
I will write on the cells. is not so fancy but works.
2 - oSheet:Rows("15"):Rowheight := 35
changes the row height, but:
uVar := oSheet:Rows("15"):Rowheight
always returns "*"
there is a way to check the Height of the Row?
TIA and regards, Euclides
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
I don't know if this is useful for you but here it is a working sample I found on my samples directory:
EMG
Code: Select all | Expand
FUNCTION MAIN()
LOCAL oExcel, oSheet
oExcel = CreateObject( "Excel.Application" )
oExcel:WorkBooks:Add()
oSheet = oExcel:ActiveSheet
oSheet:Shapes:AddPicture( "E:\XHARBOUR\SFONDO.JPG", .F., .T., 0, 0, 200, 150 )
oSheet:Shapes[ 1 ]:IncrementTop( 50 )
oSheet:Shapes[ 1 ]:IncrementLeft( 50 )
oSheet:Shapes[ 1 ]:Height = 50
oSheet:Shapes[ 1 ]:Width = 50
oExcel:Visible = .T.
RETURN NIL
EMG