Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 499473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:59:20+00:00 2026-05-13T05:59:20+00:00

I am trying to export a chart from Excel to either the wmf or

  • 0

I am trying to export a chart from Excel to either the wmf or emf format.

The code works if you export to GIF but not with WMF as the filtername.

This works:

Chart.Export FileName:="current_sales.gif", FilterName:="GIF"

But

Chart.Export FileName:="current_sales.wmf", FilterName:="WMF"

fails giving the error:

Run-time error ‘1004’:
Application-defined or object-defined
error

Powerpoint allows you to export to WMF. And I have “successfully” exported by copying the graph into Powerpoint and having Powerpoint export the image to WMF but there has to be an easier way – I hope.

I wonder if there may be a way of registering the WMF filter for Excel but I am unsure how to do this. Please help! Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:59:21+00:00Added an answer on May 13, 2026 at 5:59 am

    This copy, save method worked for me, i put it into 3 sections (declarations, saves as EMF function, and the select/copy/function call section):

    *I found this article detailing how to save to EMF then doctored it a bit to use the an ActiveChart instead of a arbitrary selection.

    First off a couple declarations:

    Option Explicit
    
    Private Declare Function OpenClipboard _
        Lib "user32" ( _
            ByVal hwnd As Long) _
    As Long
    
    Private Declare Function CloseClipboard Lib "user32" () As Long
    
    Private Declare Function GetClipboardData _
        Lib "user32" ( _
            ByVal wFormat As Long) _
    As Long
    
    Private Declare Function EmptyClipboard Lib "user32" () As Long
    
    '// CreateMetaFileA DeleteEnhMetaFile
    Private Declare Function CopyEnhMetaFileA _
        Lib "gdi32" ( _
            ByVal hENHSrc As Long, _
            ByVal lpszFile As String) _
    As Long
    
    Private Declare Function DeleteEnhMetaFile _
        Lib "gdi32" ( _
            ByVal hemf As Long) _
    As Long
    

    This is the actual save as emf function (the use of CopyEnhMetaFileA and DeleteEnhMetaFile are explained in the article):

    Public Function fnSaveAsEMF(strFileName As String) As Boolean
    Const CF_ENHMETAFILE As Long = 14
    
    Dim ReturnValue As Long
    
        OpenClipboard 0
    
        ReturnValue = CopyEnhMetaFileA(GetClipboardData(CF_ENHMETAFILE), strFileName)
    
        EmptyClipboard
    
        CloseClipboard
    
        '// Release resources to it eg You can now delete it if required
        '// or write over it. This is a MUST
        DeleteEnhMetaFile ReturnValue
    
        fnSaveAsEMF = (ReturnValue <> 0)
    
    End Function
    

    Then the select, copy, and function call section:

    Sub SaveIt()
    Charts.Add
        ActiveChart.ChartArea.Select
        Selection.Copy
        If fnSaveAsEMF("C:\Excel001.emf") Then
            MsgBox "Saved", vbInformation
        Else
            MsgBox "NOT Saved!", vbCritical
        End If
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 263k
  • Answers 263k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It seems that in theory, it resets the age of… May 13, 2026 at 12:05 pm
  • Editorial Team
    Editorial Team added an answer You will need to serialize your objects in some way… May 13, 2026 at 12:05 pm
  • Editorial Team
    Editorial Team added an answer Although this does not answer your question (jspcal answers it… May 13, 2026 at 12:05 pm

Related Questions

I am trying to geo-tag photos taken with the iPhone camera. Since I'm not
I'm trying to export from SQL Server to Oracle a table that consists of
I am trying to use the LZMA SDK to create a zip archive (either
Trying to compile a sample http class with the SDK, and getting some strange
I am trying to export a Ruby framework via XML-RPC. However I am having

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.