Share via

VBA SVG

Anonymous
2019-09-11T15:17:17+00:00

Hello everybody,

Does exist a solution in VBA to call source code SVG to construct the SVG icon? I would like to put the source code SVG in my code VBA. And a macro can call the source code for construct directly the SVG. It is possible?

Sebastien

From the following example:

 <?xml version="1.0" encoding="utf-8"?>

<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->

<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"

width="80px" height="80px" viewBox="0 0 80 80" enable-background="new 0 0 80 80" xml:space="preserve">

    <g>

<path fill="#505050" d="M18.6,0.2L7,11.8v68h60.1V0.2H18.6z M63.6,76.3H10.5V13.3l9.6-9.6h43.5V76.3z"/>

<polygon fill="#505050" points="12.3,17.9 24.7,17.9 24.7,5.5 21.2,5.5 21.2,14.4 12.3,14.4 "/>

<path fill="#505050" d="M23.4,37.9l-5.3,5.3c-0.7,0.7-0.7,1.8,0,2.5l12.4,12.4c0.3,0.3,0.8,0.5,1.3,0.5c0.5,0,0.9-0.2,1.3-0.5

l23-23c0.7-0.7,0.7-1.8,0-2.5l-5.3-5.3c-0.7-0.7-1.8-0.7-2.5,0L31.8,43.7l-5.8-5.8C25.2,37.2,24.1,37.2,23.4,37.9z M30.5,47.4

c0.7,0.7,1.8,0.7,2.5,0L49.5,31l2.8,2.8L31.8,54.3l-9.9-9.9l2.8-2.8L30.5,47.4z"/>

    </g>

</svg>

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. DaveM121 891K Reputation points Independent Advisor
    2019-09-11T15:36:43+00:00

    Hi Jean

    You cannot store an SVG is VBA, because that is a tagged vector data, you can create an SVG in VBA code, which is different to your proposition, but would achieve the same thing, you would need to be able to convert the vector points . . .etc to VBA

    Here is an example of how to do that:

    http://exceldevelopmentplatform.blogspot.com/20...

    ________________________________________________________

    Standard Disclaimer: This is a non-Microsoft website. The page appears to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.

    .

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-09-11T15:43:33+00:00

    Hehe I know is not easiest way!

    It's because I will distribute the PPAM and I would like not at the same time distribute my icons in to a side folder. I would like just distribute the PPAM.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-09-11T15:32:34+00:00

    No easy way but why would  you do that.

    Just create a Button in your ppam ribbon that adds the SVG File from a known location.

    Was this answer helpful?

    0 comments No comments