Nov 05 2021 10:25 AM
I have an excel worksheet that creates a diagram. Below are attached the original creation of the diagram and also the new version of the diagram from the modified program. The user wants to know why things are not lining up in the new version like they did in the old version. I find nowhere in any of the code related to the worksheet where positioning is determined to place the items in the diagram. Can anyone point me as to how to correct the problem?
Thanks.
Nov 08 2021 12:55 PM
I can see why your client is not totally thrilled. If you go into the VBA, shape positions may be set by using their .left and .top properties. Ranges also return such properties so the shape could either be set by the location in points or set to match the grid.
Set shp = Sheet1.Shapes(1)
shp.left = rng.left
shp.Top = rng.Top
shp.Rotation = 45
Nov 09 2021 02:22 AM
Nov 09 2021 03:47 AM
Nov 10 2021 10:47 AM
Nov 10 2021 02:12 PM
Many things are possible using VBA. What is desirable or worth the effort is another matter. For example, once the shapes have been positioned manually a 'record button' could store the position and visibility of shapes to a data table on a hidden sheet. That would allow a 'reset' button that takes the diagram back to a default state. The properties of Excel shapes are sufficient to allow the shape to be extruded and positioned in 3D with changing lighting options.
For some slightly over the top graphics see
Nov 17 2021 10:18 AM
Nov 17 2021 01:14 PM
Opening and closing files should not cause shapes to move or change proportions. Changes that are made to the grid can have drastic repercussions depending on the shape properties.
The default is for shapes to move and size with the grid.