Hi,
I have a workbook that builds a graphic based on cell values. Each graphic is a .png in the same folder as the Excel file and this works okay. However, when the code is first initiated, the sheets view zooms in about 5% then resets and I can't find out why?
I'm am using Excel O365 on Windows 10
This only seems to occur on the first graphic and I have even gone as far to reference another in the folder, but it does not cure the issue. Can anyome offer any advice?
I have a workbook that builds a graphic based on cell values. Each graphic is a .png in the same folder as the Excel file and this works okay. However, when the code is first initiated, the sheets view zooms in about 5% then resets and I can't find out why?
I'm am using Excel O365 on Windows 10
This only seems to occur on the first graphic and I have even gone as far to reference another in the folder, but it does not cure the issue. Can anyome offer any advice?
Code:
Sub Picture()
Dim x As Integer
Dim b As Integer
Dim c As Integer
Dim MyPath As String
MyPath = ActiveWorkbook.Path
c = 1
'================================================================
NewFn = MyPath & "\Enc.png" ' ZOOM APPEARS AT THIS SECTION OF CODE
ActiveSheet.Shapes.AddPicture(Filename:=NewFn, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=400, Top:=1, Width:=250, Height:=568).Select
'=================================================================
NewFn = MyPath & "\Dist_Module.png"
ActiveSheet.Shapes.AddPicture(Filename:=NewFn, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=457, Top:=14.25, Width:=142.5, Height:=30).Select
'Enclosure , Dist setting