Got an interesting issue going on after upgrading from Excel 2010 to Excel 2016. I have a macro that essentially takes several charts and uploads them to a sharepoint location so they can be viewed by all. It has been working beautifully for about two years but with the upgrade it uploads blank pictures. Trying to debug line by line and it works as intended but running in auto gives me nothing. Any ideas on what may be causing this?
Code:
Sub ExportImages()
'
'Export Images Macro
'
Application.ScreenUpdating = False
'
'Simple Glidepath export
ActiveWorkbook.Sheets("Glidepath").Activate
ActiveWindow.Zoom = 100
ActiveSheet.ChartObjects("Glide").Select
ActiveChart.Export "\\web.peccol.paccar.com\DavWWWRoot\depts\qa\SixSigma\SiteAssets\GlidepathSimple.png"
'
'Detailed Glidepath export
Dim rng As Excel.ShapeRange
Dim cht As Excel.ChartObject
Const strPath As String = "\\web.peccol.paccar.com\DavWWWRoot\depts\qa\SixSigma\SiteAssets\"
ActiveWorkbook.Sheets("Glidepath").Activate
ActiveWindow.Zoom = 100
Set rng = ActiveSheet.Shapes.Range(Array("Glidepath2"))
rng.Select
Selection.CopyPicture xlScreen, xlPicture
Set cht = ActiveSheet.ChartObjects.Add(0, 0, ActiveSheet.Shapes("Glidepath2").Width, ActiveSheet.Shapes("Glidepath2").Height)
cht.Chart.Paste
cht.Chart.ChartArea.Width = 600
cht.Chart.ChartArea.Height = 400
cht.Chart.Export strPath & "GlidepathDetailed.png"
cht.Delete
End Sub