View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
[email protected] Steven@pctamers.eu is offline
external usenet poster
 
Posts: 30
Default Insert from paint and resize

Hi Claus

I think I've finally got this doing what we want with the code below. I've also had to move the signature to row 40.

This whole issue was seriously frustrating, as I sent a working version to my user last night and it didn't work on his laptop; this morning I adapted with your code and it STILL didn't work for him. We sent it to several other users and it was fine on their computers, so an anomaly on his laptop!!

Anyway, I believe and hope this is now concluded, so a HUGE "Thank You" to yourself for your knowledge, assistance and patience.

Steve


Sub aSignature1()
Dim shp As Shape
Range("B40").Select
On Error Resume Next

Set SigPic = ActiveSheet.OLEObjects.Add(ClassType:="Paint.Pictu re", Link:=False, DisplayAsIcon:=False).Activate
Application.Wait Now + TimeValue("00:00:01")
SendKeys "%f"
SendKeys "%e"
SendKeys "%i"
SendKeys "%w"
SendKeys "4.25"
SendKeys "{TAB}"
SendKeys "1"
SendKeys "{Enter}"

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

With Range("B40")
shp.Top = .Top - 10
shp.Left = .Left
shp.Width = .ColumnWidth * 2
shp.Height = .RowHeight * 0.75
End With
End Sub