I am automating the process of creating 50+ Org Charts images but often they are empty.
I traced this to the commented step below. If I break there and then press F5 to continue the code, it creates the image.
But if I don't break then many images end up 2KB in size, which is empty.
Does anyone have a tip to replicate what the breakpoint does?
I traced this to the commented step below. If I break there and then press F5 to continue the code, it creates the image.
But if I don't break then many images end up 2KB in size, which is empty.
Does anyone have a tip to replicate what the breakpoint does?
Code:
Dim shp As Shape, sht As Worksheet
Dim chtObj As ChartObject
Dim objTemp As Object
Dim objPicTemp As Object
For Each shp In ActiveSheet.Shapes
If shp.Type = msoSmartArt Then
Call ConfigureShape(shp)
Set objTemp = shp
End If
Next shp
Set sht = Workbooks("GraphicsExporter.xlam").Worksheets("PicHolder")
Set chtObj = sht.ChartObjects(1)
Do While Not Application.Ready: Sleep 10000: Loop
objTemp.Copy
Do While Not Application.Ready: Sleep 10000: Loop ' Image size is 2KB unless manually step over this
Set objPicTemp = ActiveSheet.Pictures.Paste