+ Reply to Thread
Results 1 to 2 of 2

Excel 2016 - problems with macro that generates a jpg image since upgrade to Excel 2016

  1. #1
    Registered User
    Join Date
    12-18-2016
    Location
    Hong Kong
    MS-Off Ver
    2016
    Posts
    1

    Excel 2016 - problems with macro that generates a jpg image since upgrade to Excel 2016

    Hello community,
    I have since the upgrade to Excel 2016 experienced a problem with a macro that generates a jpg image of a designated excel area. In the previous versions, it worked without problems but since the upgrade the macro only generates a blank jpg. Have anyone experienced something similar? The code is the following:
    Public Function exportRange(area As Range, ws As Worksheet, path As String)
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True

    Dim output As String
    Dim zoom_coef As Single
    output = path

    zoom_coef = 70 / ws.Parent.Windows(1).Zoom

    area.CopyPicture xlPrinter
    Dim chartobj As ChartObject: Set chartobj = ws.ChartObjects.Add(0, 0, area.Width * zoom_coef, area.Height * zoom_coef)
    chartobj.Select
    chartobj.Chart.Paste
    chartobj.Chart.Export output, "jpg"
    chartobj.Delete
    End Function
    Last edited by NikHag; 12-19-2016 at 01:37 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    11,498

    Re: Question You are subscribed to this thread Applies to Office Excel Windows 10 Office

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    You must use code tags for all code
    Ben Van Johnson

+ 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. Replies: 1
    Last Post: 08-07-2016, 05:52 PM
  2. [SOLVED] Code not working in Office 2010 and Office 2016
    By amitmodi_mrt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2016, 02:48 PM
  3. Replies: 2
    Last Post: 05-24-2016, 10:43 PM
  4. What's New and Improved in Office 2016 for Office 365
    By AlKey in forum The Water Cooler
    Replies: 5
    Last Post: 05-06-2016, 07:52 AM
  5. Conditional formatting with udf issues with Office 2016 / Office 365
    By andikeep2580 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-22-2016, 10:58 AM
  6. Update from Office 97 to Office Professional Plus 2016
    By billd73 in forum Excel General
    Replies: 0
    Last Post: 12-28-2015, 05:15 PM
  7. Default excel template in Office 2016?
    By honeybadger_rgr in forum Excel General
    Replies: 0
    Last Post: 12-10-2015, 12:19 PM

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