Author Topic: Macro recording fail  (Read 5892 times)

0 Members and 1 Guest are viewing this topic.

AndrewJ

  • Jr. Member
  • **
  • Posts: 20
Macro recording fail
« on: July 05, 2013, 10:36:23 AM »
Hello!

I am trying to record a Macro in order to extract a code for creating a new data graphic (I want to automate the creation of little orange circles on top of process boxes in order for them to display process numbers).
However, when I start recording the macro, the data graphic options get greyed out.

1: What can I do to get around this?
2: How can I figure out the code to do this if I can't record a macro and then analyze the results? (I have already checked the SDK and couldn't find this)
3: Why is this happening? It's ridiculous!

Thanks in advance!
Andrew

AndrewJ

  • Jr. Member
  • **
  • Posts: 20
Re: Macro recording fail
« Reply #1 on: July 05, 2013, 11:17:30 AM »
Just to give you guys an idea, this is what I am trying to record in a macro and avoid having to get the employees to do manually every single time they want to number a process box, especially since boxes might be added after the initial numbering is done.
My instructions were as follows...

1: CTRL click all processes that will be numbered
2: DATA tab > Data Graphics > Create New Data Graphic > New Item...
3: In the New Item window, select:
   Data Field: More Fields > Shape Data > Process Number (then click OK)
   Displayed as: Text
   Style: Circle callout
   Value Format: @+   
   Value Length: 10
4: Click OK
5: Under Default position, select:
   Horizontal: Left Edge
   Vertical: Top Edge
6: Click OK
7: Click “Yes” to apply this data graphic to selected shapes
Andrew


AndrewJ

  • Jr. Member
  • **
  • Posts: 20
Re: Macro recording fail
« Reply #3 on: July 05, 2013, 11:35:43 AM »
Thank you,

But is there any help anyone is willing to offer me for this short of having to purchase and read an entire book?
Any help would be much appreciated, either in figuring out how to get Visio to stop greying out what I'm trying to record through a macro, by telling me how I can extract this code otherwise or by telling me what code to use if you could be that generous.

By the way, I am using Visio 2013.
Andrew

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: Macro recording fail
« Reply #4 on: July 06, 2013, 08:05:39 AM »
You might start here ( the assumption is that you already have the visio sdk)

http://msdn.microsoft.com/en-us/library/office/ff766215.aspx

al

AndrewJ

  • Jr. Member
  • **
  • Posts: 20
Re: Macro recording fail
« Reply #5 on: July 08, 2013, 10:14:37 AM »
Thank you.
But from what I am reading, it means that I have to already have created a data graphic?
That defeats the purpose of what I am trying to accomplish since you can simply select all shapes and chose the data graphic and it's done.
What I am trying to accomplish programmatically is creating that data graphic programmatically and integrating that code into a macro.
Can that be done?
Andrew