View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Insert from paint and resize

Hi Steve,

Am Thu, 25 Feb 2016 10:25:47 -0800 (PST) schrieb :

I see. Do you think it'll be possible with the import pictures from Paint?


I have no experience in that.

But I have done it now with a workaround. The last inserted picture has
the highest number and is

With ActiveSheet
Set shp = .Shapes(.Shapes.Count)


Try:
Sub Test()
Dim shp As Shape

On Error Resume Next
Set SigPic = ActiveSheet.OLEObjects.Add(ClassType:="Paint.Pictu re",
Link:=False, DisplayAsIcon:=False).Activate

With ActiveSheet
Set shp = .Shapes(.Shapes.Count)
End With

With Range("B39")
shp.Top = .Top
shp.Left = .Left
shp.Width = .ColumnWidth
shp.Height = .Height
End With
End Sub

the inserted picture has by default aspect ratio locked. Therefore the
width can not be larger than the heigth.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional