1

Topic: Excel VBA to save Picture

There is a template of the document which adjustments are saved in XML. Everything is saved, colors, effects, position of elements, contents of cells .
That it would be desirable: On a template the place under a logo (Picture) is taken and this logo too is to be saved in XML with all remaining adjustments.
Rummaged all Google and could not find a normal method to save element Picture in a flow even in a file from VBA.
Found one perverted method of export through schedule creation.
It would be desirable to export the image "as is" with initial resolution and with all transparences .
Excel 2010

2

Re: Excel VBA to save Picture

I could not understand, where exactly initially there is a picture?
If it is a question of a file xlsx - that it is possible to get it directly from this file for it represents zip-archive and images itself are stored as normal files.

3

Re: Excel VBA to save Picture

Shocker. Pro;
The picture is on sheet Excel, the file is open by the user. But it basically idea. It is possible to try to save violently a file and to climb in archive.
There is any example of the similar code on VBA?

4

Re: Excel VBA to save Picture

In general the logic is clear:
Opens. \xl\workbook.xml, the necessary sheet by name is searched and remembered it r:id
Opens. \xl \_ rels\workbook.xml.rels and in it the sheet name (Target) on Id is searched
The file specified in Target (the previous step) opens and in it the element drawing is searched and remembered r:id
The file \xl\worksheets \_ rels\and Target opens and ".rel" in it the element is searched and in it is searched Relationship on Id = r:id and remembered Target
The file specified in Target (the previous step) opens and in it the element with a name <xdr:cNvPr name = "Member name" is searched
Concerning the found element it is necessary to find an element.\.\xdr:blipFill\a:blip and in it to read property r:embed
File Target and ".rel" opens and in it is searched Relationship on Id = r:embed and and in it Target specifies in a location of a file of a picture
Easily and simply :-) Can at whom there is a ready code?:D