Page 1 of 1

Excel Command - still need help

Posted: Thu Apr 05, 2007 6:29 pm
by Jeff Barnes
Hi Everybody,

I thought I had this figured out but no such luck. (Re-size an inserted image)

I need to convert the folowing code to fwh:

Code: Select all

Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 286.5
Selection.ShapeRange.Width = 657#
Selection.ShapeRange.Rotation = 0# 
I tried:

Code: Select all

oSheet:Pictures:Height:= 286.5
oSheet:Pictures:Width:= 657 
But that resized ALL images that I had inserted. I want to be able to re-size them as I insert them leaving previous images alone.

Thanks,
Jeff

Re: Excel Command - still need help

Posted: Thu Apr 05, 2007 7:44 pm
by Enrico Maria Giordano

Code: Select all

FUNCTION MAIN()

    LOCAL oExcel, oSheet

    oExcel = CreateObject( "Excel.Application" )

    oExcel:WorkBooks:Add()

    oSheet = oExcel:ActiveSheet

    oSheet:Shapes:AddPicture( "C:\XHARBOUR\SFONDO.JPG", .F., .T., 0, 0, 200, 150 )

    oSheet:Shapes[ 1 ]:Height = 50
    oSheet:Shapes[ 1 ]:Width = 50

    oExcel:Visible = .T.

    RETURN NIL
EMG