Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
OLEobject on the sheet
Dear Experts,
I have an image control on the worksheet but I couldn't find right property name to change the path of the image file in the macro. Actualy I used the macro recorder to generate the code creating the image box on the sheet and run the macro the create it automatically. The code is like this ActiveSheet.OLEObjects.Add(ClassType:="Forms.Image .1", Link:=False, DisplayAsIcon:=False, Left:=240, _ Top:=32.25, Width:=345.75, Height:= 182.25).Select What can I do next to insert the image filename for this control? Thanks for your help Ryan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
OLEobject on the sheet
This worked ok for me:
Option Explicit Sub testme01() Dim OLEObj As OLEObject Dim myRng As Range Set myRng = Worksheets("sheet1").Range("c9:d16") With myRng Set OLEObj = .Parent.OLEObjects.Add(ClassType:="Forms.Image.1", _ Link:=False, DisplayAsIcon:=False, Left:=.Left, _ Top:=.Top, Width:=.Width, Height:=.Height) End With OLEObj.Object.Picture = LoadPicture(Filename:="C:\pict.jpg") End Sub Ryan wrote: Dear Experts, I have an image control on the worksheet but I couldn't find right property name to change the path of the image file in the macro. Actualy I used the macro recorder to generate the code creating the image box on the sheet and run the macro the create it automatically. The code is like this ActiveSheet.OLEObjects.Add(ClassType:="Forms.Image .1", Link:=False, DisplayAsIcon:=False, Left:=240, _ Top:=32.25, Width:=345.75, Height:= 182.25).Select What can I do next to insert the image filename for this control? Thanks for your help Ryan -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel sheet bootom half sheet goes behind top part of sheet | Excel Worksheet Functions | |||
Change and refresh OLEObject showing Excel chart on Access form. | Charts and Charting in Excel | |||
Duplicate sheet, autonumber sheet, record data on another sheet | Excel Worksheet Functions | |||
How do I select price from sheet.b where sheet.a part no = sheet.b | Excel Worksheet Functions | |||
Using a variable to represent a Checkbox Name(OLEObject) | Excel Programming |