Combine Code for Smart Art Charts

User avatar
Stefan_Sand
4StarLounger
Posts: 415
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Combine Code for Smart Art Charts

Post by Stefan_Sand »

Hello,
i have a nice solution, which can build up WBS and organisational structures.Using a dropdown field (in N2), it is possible to build up 4 different Smart Art chart types. When i started, i split the code into two different solutions, because if you want to use spotlights you have to add 2 lines of code in the macro.

Now , i have been asked to combine the solutions into only one macro. But i didn´t find a way.

I only got out, that in the Smart Art Chart "pictureOrgChart+Icon" i have the code lines added for the nodes:

If Range("G2").Value = "" Then
QNode.Shapes(2).Fill.UserPicture (ThisWorkbook.Path & "\img0.wmf")
Else
QNode.Shapes(2).Fill.UserPicture (ThisWorkbook.Path & "\img" & Range("G2").Value & ".wmf")
End If
and the same adopted for the child shapes

is there a way to combine it?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combine Code for Smart Art Charts

Post by HansV »

Would you like to add an option to the dropdown in N2?
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combine Code for Smart Art Charts

Post by HansV »

Sorry, I see Pic ORG is already in the list.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combine Code for Smart Art Charts

Post by HansV »

In the attached version, I have modified the code of the Org macro to handle the Pic Org case.
I cannot test it since I don't have the images needed, so please test it carefully.
Smart PSP Test 2020 V2.xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Stefan_Sand
4StarLounger
Posts: 415
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Re: Combine Code for Smart Art Charts

Post by Stefan_Sand »

Hi Hans,

When i changed the line Pic Org to Pic ORG, it worked to get the right Smart Art style, but it does not get the pics.
I attached my list of 30 self made wmf Stoplights.

Anyway thank you so far.

Stef
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combine Code for Smart Art Charts

Post by HansV »

Thanks, I'll take a look.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combine Code for Smart Art Charts

Post by HansV »

I see that I made a few mistakes. This should work better:
Smart PSP Test 2020 V2.xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Stefan_Sand
4StarLounger
Posts: 415
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Re: Combine Code for Smart Art Charts

Post by Stefan_Sand »

thank you, Hans