Calling excel render via vba
Calling excel render via vba
Hi
Just was wondering if it was possible to call excel render via vba.
My use is for random worksheet generation, so I would create formulas to generate random questions and answers (mainly undergrad calculus), then I'd like to to replace the latex questions and answers with the rendered gif formula.
At the moment I have to manually go into each cell and click. I tried recording this but clicking on excel render doesn't generate any code.
Thanks
6 Jul 11, 6:08AM
Hi
After some fun filled hours playing around with excel, I started using the .xla (2003) file and found I can do it with that.
Application.CommandBars.Item("CodeCogs").Controls(1).Execute
replacing 1 with 1-4 depending on which button.
I tried for hours trying to get
Application.CommandBars.ExecuteMso("x1:b_equate") to work with the 2007 version, replacing x with the ProgID and other possibilities.
6 Jul 11, 7:27AM
Thats a very clever approach for our VBA code. I'm surprised it doesn't also work in the 2007 version.
In the future version we will allow you to write something like
=rendereqn(A3)directly into a cell or from VBA. However we haven't enabled this feature at the moment, its somewhat down the list of priorities. Let me see if I can't bump the priorities :) How are you finding Excel Render otherwise?
6 Jul 11, 7:40AM
Hi thanks for your reply.
Yep finding it very useful. I'm actually using latex and vba code to come up with the the questions and answers (I have a fair few rules to enforce, ie. integer answers etc)
I was going to use the microsoft (unsupported) mathtype thing but that looked like a real pain and I already knew latex.
Putting everything on the the worksheet (typesetting) was very easy with ActiveSheet.Shapes.
As long as I ran it sequentially (ie. two columns of say 10 rows each) I could just pick them up with ActiveSheet.Shapes.Item() and place them on to the the print area perfectly with
For s = 1 To (ActiveSheet.Shapes.Count / 2)
ActiveSheet.Shapes(s).Top = Range("H" & s).Top
ActiveSheet.Shapes(s).Left = Range("H" & s).Left
Next s
For s = (ActiveSheet.Shapes.Count / 2) + 1 to ActiveSheet.Shapes.Count
ActiveSheet.Shapes(s).Top = Range("I" & s).Top
ActiveSheet.Shapes(s).Left = Range("I" & s).Left
Next s
I've been looking for years for some decent worksheet creation tools and had given up and decided to create my own.
6 Jul 11, 8:52PM
Sounds really interesting and it great to see Excel Render being put to use like this.
I'm not sure of the audience for your tool, but if you would like to promote it on CodeCogs then let me know. It would be great to have a page showing example spread-sheets and what others are using the tool for.
I'll report back here when we enable the rendering from a function cell.
Login