Macro stopped working after upgrade to 2016

cadueitt

New Member
Joined
Aug 11, 2016
Messages
2
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
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Since it is working when you step through code but failing when running at full speed, try adding DOEVENTS or even a pause of a 1/2 second or more before and/or after pasting.
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,302
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top