Jun 30 2018
05:06 PM
- last edited on
Jul 25 2018
09:53 AM
by
TechCommunityAP
Jun 30 2018
05:06 PM
- last edited on
Jul 25 2018
09:53 AM
by
TechCommunityAP
I am interested in copying the curve from the excel scatter with smooth lines only to MS Visio using VBA code. I have tried selecting the curve from a excel XYScatterSmoothNoMarkers graph, but not able to just copy and paste just the curve, but the complete chart with the curve only.
I have written some VBA code (taking pieces from various articles), to generate the chart and to make only the curve visible and copy this. This will work for me, I am able to insert it into Visio, but this method gives me two issues to resolve. If I am unable to just copy the curve itself, but need to copy the chart, then I need to resolve the following 2 issues:
1) I need the graph is have not distortion from having different scaling for the x and y coordinates. That is if I move on x axes 1 unit, that must be exactly the same as moving on y axes 1 unit. The x and y 1 unit must be the same or I have a distortion of the plot. I haven't found a way to control this with VBA, and the closes thing is manually doing.
2) The last issue is to located the start of the graph or curve and for me to adjust the placement of the chart to a certain location of shapes on my Visio drawing. The shape is a circle and I just need the curve touching the bottom part of the circle. If a solution can be found to do this with VBA code too, then copying the chart will work for me. I do have the (x,y) location of the connection location I want.
Below if a sample of some VBA Code that I am able to generate the curve and making the chart invisible when pasted into Visio. But, the 2 issues need to be resolve unless I am able to copy the curve itself and determine the end points. Then I can write VBA Code to connect to my Visio drawing.
Here is my sample VBA Code: