Excel Command - still need help

Post Reply
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Excel Command - still need help

Post 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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Excel Command - still need help

Post 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
Post Reply