I have several queries running in the background of our system which export various pieces of data. Yesterday we finally upgraded the servers from Excel 2007 to 2010. Most of my macros are running fine. However, the code below errors out at the cht.Chart.Paste line. This code is basically looking at cells J23:J25, creating a picture, and then exporting it to my network folder. I would appreciate any help you guys can offer. I'm open to using other code, but so far haven't found anything that will work. Thanks!!!
Code:
Dim rng As Excel.Range
Dim cht As Excel.ChartObject
Const strPath As String = "D:\data\fci_queries\Real Time Stats\stats\wpimages\"
Application.ScreenUpdating = False
Set rng = Excel.Range("J23:J25").CurrentRegion
rng.CopyPicture xlScreen, xlPicture
Set cht = ActiveSheet.ChartObjects.Add(0, 0, rng.Width + 0.01, rng.Height + 0.01)
[B][COLOR=#ff0000]cht.Chart.Paste[/COLOR][/B]
cht.Chart.Export strPath & "queue.png"
cht.Delete