How to reach "Insert chart" dialog in PowerPoint2007 using vba?

111 views Asked by At

I apologise in advance if this topic has been covered in another thread, but i am not able to find out where it is.

I am trying to reach the "Insert Chart" dialog from PowerPoint 2007. enter image description here

According to the documentation I have reviewed this can be achieved with the following code:

Application.CommandBars.FindControl(Id:=17).Execute

or:

Application.CommandBars("Menu Bar").FindControl(Id:=17, recursive:=True).Execute

However, instead of showing the dialog, this code inserts a new column chart in the current slide. On top of that, this chart is also an NSgraph chart (which is PowerPoint2003 format), and i am really looking forward to inserting a chart with the new format.

Is it possible to reach that dialog in PowerPoint2007? Because even the MSDN documentation states that the ID is 17.

Any information would be very much appreciated.

Thanks in advance and best regards!

1

There are 1 answers

0
koishi On

Finally, I have found a workaround to this matter.

I thought of using the shortcuts in the application in order to invoke that dialog and it seems to be working. In office 2007, that dialog can be invoked by pressing ALT+B+C, so my macro reproduces that behaviour:

ActivePresentation.Application.Activate
VBA.SendKeys "%bc", True

Maybe this is not the best approach, but the Ribbon hierarchy is too complicated for me.