The following code will trigger Freeform Shape (Like clicking the ShapeFreeform button) (In Office365 64Bit on Win10): Application.CommandBars.FindControl(ID:=200).Execute
EDIT - The name in brackets identified far below (##) can also be used in quotes in the following code to trigger the button.
CommandBars.ExecuteMso ("ShapeFreeform")
(Curiously, "ShapeScribble" (ID:=409) seems to do exactly the same thing as "ShapeFreeform".)
Using an ActiveX Command Button will work, whether the Macro it triggers is in Sheet Code, or whether the sheet code calls a Macro in a Module.
Using a FORM button to trigger this will NOT work (whether the macro is in the Sheet Code or a Module).
(Unknown whether this is a bug or intentional)
Assigning a shortcut key to trigger the macro appears to be unreliable unless a delay before the execute line is used.
With zero delay, mostly a "ghostly" diagonal line is inserted instead, which disappears if you switch to "Page Layout View" and back.
Using Application.Wait and 1 second, it mostly works, but as the actual wait can vary from (very near)0 to 1 second, when it is too short it will fail like above.
Using Application.Wait and 2 seconds, it appears reliable (as the wait is from (near)1 to 2 sec).
The Sleep function is far more accurate but is a call to an external library. For both, See How to pause for specific amount of time? (Excel/VBA)
I did not try Sleep, so you will have to experiment with what delay works for you.
Essentially, the code puts Excel into a "drawing mode" and other types are possible, like Freeform Curve (button named ShapeCurve), which ID is 1041. Identifying the ID of a button can be quite a chore unless someone knows an easier method than this?:
on the ribbon hover over the desired button until the name pops up and remember it > rightclick on the ribbon and click "Customise the Ribbon" > in the first column click "All Commands" (NOT All Tabs) > find the remembered name in the alphabetical list and hover over it until info pops up. The actual "Code" name for the button will be the one in brackets (##). Again, remember this. > look this up online by searching for "office fluent ui command identifiers". A good source is "https://github.com/OfficeDev/office-fluent-ui-command-identifiers". Choose your office version and then the product used (in our case excel... use the excelcontrols.xls) and then search for the remembered name to find the "Policy ID" number.
(Note that only some of the button ID's can be "clicked" by the code first mentioned. Others need a different approach and/or parameters as well).