How to Detect SVG Support in Excel with VBA
Question details
The user needs a reliable VBA method to determine whether their specific version and build of Microsoft Excel supports inserting and rendering SVG vector images.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Automating the insertion of scalable vector graphics (SVG) in Excel worksheets using a VBA macro without causing errors for users on older builds.
- Observed behavior
- Relying solely on the major Excel version number is ineffective because SVG support varies significantly across different update channels and specific builds.
Ensure you have the Developer tab enabled in Excel to access the VBA editor. It is highly recommended to prepare a fallback PNG or JPG image file to test your macro's error-handling capabilities.
Attempt SVG Insertion with a Fallback Mechanism
Since version and build checks are unreliable across different update channels, the most robust approach is attempting to insert the SVG and catching any rendering failures directly.
Microsoft 365 update channels (such as Monthly versus Semi-Annual Enterprise) introduce features at different build numbers, making hardcoded version checks brittle. A practical VBA workaround involves attempting to insert the SVG, validating its success, and reverting to a standard raster image format if the vector fails.
Press Alt + F11 to launch the Visual Basic for Applications (VBA) editor and insert a new Module from the Insert menu.
Create a macro that attempts to insert the SVG file into the active worksheet using the `ActiveSheet.Pictures.Insert` method.
Wrap your insertion code with `On Error Resume Next`. If Excel throws an error, or if the inserted picture object returns invalid dimensions (meaning it failed to render), immediately delete the broken object.
Add a conditional statement that detects the failure flag. If the SVG validation fails, instruct your macro to insert your alternative image format, such as a PNG or JPG.
Check Application Version and Licensing Registry Keys
If you prefer to evaluate the environment before executing insertion commands, you can write a script to check the Excel version and subscription status via the Windows Registry.
Experience Seamless Image Compatibility with WPS Office
Struggling with fragmented feature support across different Excel update channels? WPS Office offers a highly compatible alternative. Enjoy consistent support for graphics and standard VBA macros without worrying about convoluted version checks.

Frequently Asked Questions
Why does Excel version 16.0 support SVGs on some computers but not others?
Microsoft 365 utilizes different update channels like Monthly and Semi-Annual. Two computers might share the same major version (16.0) but have entirely different build numbers and feature sets based on their assigned channel.
Can I simply check if Application.Version equals 16.0 to detect SVG support?
No. The version number 16.0 applies broadly to Excel 2016, 2019, 2021, and Microsoft 365. SVG support was introduced in specific, later builds of Microsoft 365, making major version checks inadequate.
What happens if VBA tries to insert an SVG into an unsupported Excel build?
Depending on the exact build installed, Excel might throw a VBA runtime error, or it may fail silently by inserting a blank, unrenderable picture object onto the spreadsheet.
What is the best fallback image format if SVGs fail to load?
PNG is the recommended fallback format because it supports transparent backgrounds like SVG, while maintaining universal compatibility across all older versions of Excel.




