I'm having reports with graphic elements (imported SVG pictures) in it. The problem is that the reports are growing to substantial sizes. The empty report Excel sheet is 57Kb, the imported SVG files are all between 30-60Kb. When I place about 15 SVG files, my XLSX file grows to 15Mb or larger. I am using Microsoft� Excel� for Microsoft 365 MSO (Version 2406 Build 16.0.17723.20000) 64-bit (Insider version)
If I use the option in Excel (after selecting the graphic) Graphic Format > Convert to Shape, my file shrunk below 1Mb again.
As far as I know there is no VBA method to choose this option, so I'm stuck with the only alternative, SendKeys. The shortcut keys to select this command is ALT J G C 1 in that order.
I created a macro for this purpose. However, this does not seem to work. The selected keys are sent to the VBA application and not to the worksheet with the picture in it.
A simple example will illustrate this
When I select this macro from the workbook (run macro) it works perfectly. But I want to integrate it in a larger macro that generates about 30 different reports every month. How can I make sure that the sendkeys are send to the workbook with the graphic element in it?
Art
Bookmarks