Hi,
Hi I had to modify excel template VBA code to make image logo persistent outside the network
so I change simple Picture.Insert(pfile) to:
Set vOldShape = vSheet.Shapes(pName)
If Not vOldShape Is Nothing Then
vLeft = vOldShape.Left
vTop = vOldShape.Top
vWidth = vOldShape.Width
vHeight = vOldShape.Height
'Set vNewShape = vSheet.Pictures.Insert(pFile) -> old code
'changes:
Set vShape = vSheet.Shapes.AddPicture(Filename:=pfile, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoCTrue, _
Left:=vLeft, _
Top:=vTop, _
Width:=-1, _
Height:=-1)
With the commented out old code image is place correctly, but with the AddPicture is shifted to the left, why could it be?
I tried also to lock aspect ratio or not usuing -1 just properties of old image but not luck, anybody can help?
Hi I had to modify excel template VBA code to make image logo persistent outside the network
so I change simple Picture.Insert(pfile) to:
Set vOldShape = vSheet.Shapes(pName)
If Not vOldShape Is Nothing Then
vLeft = vOldShape.Left
vTop = vOldShape.Top
vWidth = vOldShape.Width
vHeight = vOldShape.Height
'Set vNewShape = vSheet.Pictures.Insert(pFile) -> old code
'changes:
Set vShape = vSheet.Shapes.AddPicture(Filename:=pfile, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoCTrue, _
Left:=vLeft, _
Top:=vTop, _
Width:=-1, _
Height:=-1)
With the commented out old code image is place correctly, but with the AddPicture is shifted to the left, why could it be?
I tried also to lock aspect ratio or not usuing -1 just properties of old image but not luck, anybody can help?