FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour OleExcel
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
OleExcel
Posted: Fri Aug 01, 2008 03:13 PM

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

Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
OleExcel
Posted: Fri Aug 01, 2008 05:11 PM
Euclides,

maybe you need something like this:

    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"
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
OleExcel
Posted: Tue Aug 05, 2008 02:02 PM

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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
OleExcel
Posted: Tue Aug 05, 2008 03:11 PM
I don't know if this is useful for you but here it is a working sample I found on my samples directory:

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
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
OleExcel
Posted: Wed Aug 06, 2008 07:18 AM

Euclides,

as oSheet:Rows() can contain several rows, there isn't a defined rowheight.
but oSheet:Cells( 1, 15):rowheight seems to work fine, as it only contains this particular cell.

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
OleExcel
Posted: Wed Aug 06, 2008 12:43 PM

Thanks Enrico and Gilbert
The project is almost ready.
I only have to find a way to write text into the shapes.
Regards and thanks again.
Euclides

Continue the discussion