+ Reply to Thread
Results 1 to 10 of 10

Save Chart as jpg in a defined path

  1. #1
    Registered User
    Join Date
    07-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    98

    Save Chart as jpg in a defined path

    Hi there,

    I do not know much about VBA programming. Nevertheless I have 4 tabs (Sheet 1, Sheet 2, Sheet 3 and Sheet 4) in which there is one Chart in each. I want them to be converted into jpgs via one Button which is on a Separate Sheet. The jpgs should then be saved on my desktop as Sheet1.jpg, Sheet2.jpg, Sheet3.jpg and Sheet4.jpg.

    Can you please help me find the right VBA code to have this accomplished.

    Many thanks in advance.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Save Chart as jpg in a defined path

    Try this. For chart images, GIF is the recommended format.


    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Save Chart as jpg in a defined path

    Since I did this before AlphaFrog's post, adjust as needed.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Save Chart as jpg in a defined path

    Sorry for the late reply.

    Both codes work absolutely fine.

    What do I have to change to uplode the picture onto a virtual server? "SpecialFolders("path name")" doesnt seem to cut it.

    Thanks in advance.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Save Chart as jpg in a defined path

    Just put the path in quotes e.g."

    strPath = "G:\Mypath\MyFolder"

  6. #6
    Registered User
    Join Date
    07-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Save Chart as jpg in a defined path

    AlphaFrog, amazing!

    I have one more issue. I need it in a much higher resolution. something along the line of 1080p.

    Is that possible?

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Save Chart as jpg in a defined path

    Make the charts larger.

  8. #8
    Registered User
    Join Date
    07-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Save Chart as jpg in a defined path

    Unfortunately, this does not work. See attached file.
    Attached Images Attached Images

  9. #9
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Save Chart as jpg in a defined path

    You will need to know the height as well. See if this helps. https://www.reddit.com/r/excel/comme...w_to_export_a/

  10. #10
    Registered User
    Join Date
    07-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Save Chart as jpg in a defined path

    Hi Kenneth,

    Thanks for the link. Good read. How can I implement this into the code above.

    Sorry to be a pain but I really have no clue about VBA.

    Thanks in advance.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Create a folder to save a file and two subfolders in a defined path
    By Biplab1985 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-01-2015, 11:43 AM
  2. [SOLVED] Correct save path and syntax to save workbookdirectly into ONEDRIVE subfolder
    By osbertdebroilg in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-29-2015, 06:27 PM
  3. Save the open sheet in a path with a save as dialogue box and also create two folders
    By Biplab1985 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2015, 05:19 PM
  4. Auto save IE file download dialog box in a user defined path
    By sugaprasad in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-27-2014, 05:21 AM
  5. Replies: 2
    Last Post: 12-15-2013, 04:27 PM
  6. [SOLVED] Save As Dialog Box - Default Path and File Name, User Selects Sub Folder from Default Path
    By christenprochaska in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 05:17 PM
  7. [SOLVED] Run Time 1004 - App Defined or Object defined error with String defined path structure
    By sarails in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2012, 09:38 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1