Resize Embedded Object

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
Hello I want to add to this code width=50 and height=100. basically keep a standard size of object when marco runs.
any ideas?

Code:
Sub AttachTicket()
Range("J18").Select
Dim vFile As Variant
vFile = Application.GetOpenFilename("All Files,*.*", Title:="Find file to insert")
If LCase(vFile) = "false" Then Exit Sub
ActiveSheet.OLEObjects.Add Filename:=vFile, Link:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0150048383C9}\xlicons.exe", _
IconIndex:=0, IconLabel:="Signed Ticket Attached! Double Click to View"
End Sub

thanks
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,351
Office Version
  1. 365
Platform
  1. Windows
Perhaps something like this.
Code:
Sub AttachTicket()
Dim vFile As Variant
Dim x As OLEObject

    Range("J18").Select

    vFile = Application.GetOpenFilename("All Files,*.*", Title:="Find file to insert")
    If LCase(vFile) = "false" Then Exit Sub
    Set x = ActiveSheet.OLEObjects.Add(Filename:=vFile, Link:=False, DisplayAsIcon:=True, IconFileName:= _
                                       "C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0150048383C9}\xlicons.exe", _
                                       IconIndex:=0, IconLabel:="Signed Ticket Attached! Double Click to View")

    x.Height = 100
    x.Width =50

End Sub
 

Forum statistics

Threads
1,172,131
Messages
5,879,230
Members
433,412
Latest member
diakaoma

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top