Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Sheet view zooms in slightly when running code

Status
Not open for further replies.

davefish

Technical User
Jul 26, 2002
169
GB
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?

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top