The workbook I am working on in Excel uses graphics with 3d properties which are set in VBA. I just changed an image in the workbook, and now Excel complains that it can’t execute any of the following lines of code:
Selection.ShapeRange.ThreeD.Depth = fsdoord
Selection.ShapeRange.ThreeD.ExtrusionColor.RGB = carcol
Selection.ShapeRange.ThreeD.PresetLightingDirection = msoLightingBottom
The error produced is
Run-time error '70':
Permission denied
I can still apply all the other properties to this shape; it only errors when I try to execute the lines relating to the 3d properties.
Does anyone have any insight into why this might be happening?
Thanks in advance…
Okay, I sort of found the problem. When I replaced the image, I deleted the original image and inserted a new one using Insert>Image>From File… It turns out that the original image must have had some sort of 3d properties applied already, because when I replaced the image by just changing the fill colour of the auto-shape, it worked (in other words, I kept all the properties and only changed the fill).