Results 1 to 1 of 1

Thread: Runtime Error 481 invalid figure when PNG

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    26
    Rep Power
    0

    Runtime Error 481 invalid figure when PNG

    Gents,

    I changed my current code for displaying graphs on my userform

    I encounterd at the beginning for each file type gif,jpg and PNG a runtime error 481. But i looked at the code provided in Chart.export creates corrupt files randomly to adjust my code.

    Code:
    Private Sub UpdateChart()
        
        Dim i As Long
        
        For i = 1 To 3
            Sheets("DASHBOARD").ChartObjects(i).Activate
            ActiveChart.Parent.Width = 400
            ActiveChart.Parent.Height = 180
        
        '   Save chart as GIF
            Fname = ThisWorkbook.Path & Application.PathSeparator & i & "_tijdelijk_bestand.png"
            ActiveChart.Export Filename:=Fname, FilterName:="PNG"
            Me.Controls("Image" & i).Picture = LoadPicture(Fname)
        Next
    End Sub
    Now JPEG, and GIF are working fine without error, but i want to use PNG due to transparency and higher quality vs GIF. but as soon i use the PNG it export the firt PNG and after that gives me the 481 error again.

    What goes wrong ??


    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://www.youtube.com/watch?v=QdwDnUz96W0&lc=Ugx3syV3Bw6bxddVyBx4AaABAg
    https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=UgxsozCmRd3RAmIPO5B4AaABAg. 9fxrOrrvTln9g9wr8mv2CS
    https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugw6zxOMtNCfmdllKQl4AaABAg
    https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=UgyT1lo2YMUyZ50bLeR4AaABAg. 9fz3_oaiUeK9g96yGbAX4t
    https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugx5d-LrmoMM_hsJK2N4AaABAg.9fyL20jCtOI9g7pczEpcTz
    https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=UgyT1lo2YMUyZ50bLeR4AaABAg. 9fz3_oaiUeK9g7lhoX-ar5
    https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugx5d-LrmoMM_hsJK2N4AaABAg.9fyL20jCtOI9gD0AA-sfpl
    https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugx5d-LrmoMM_hsJK2N4AaABAg.9fyL20jCtOI9gECpsAVGbh
    https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugw6zxOMtNCfmdllKQl4AaABAg. 9g9wJCunNRa9gJGhDZ4RI2
    https://www.youtube.com/watch?v=Sh1kZD7EVj0&lc=Ugz-pow-E8FDG8gFZ4l4AaABAg.9f8Bng22e5d9f8hoJGZY-5
    https://www.youtube.com/watch?v=Sh1kZD7EVj0&lc=Ugxev2gQt7BKZ0WYMfh4AaABAg. 9f6hAjkC0ct9f8jleOui-u
    https://www.youtube.com/watch?v=Sh1kZD7EVj0&lc=Ugxg9iT7MPWGBWruIzR4AaABAg
    https://www.youtube.com/watch?v=tzbKqTRuRzU&lc=UgyYW2WZ2DvSrzUKnJ14AaABAg
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 09-22-2023 at 05:22 PM.

Similar Threads

  1. Difference Between 'On Error GoTo 0' And 'On Error GoTo -1'
    By Transformer in forum Familiar with Commands and Formulas
    Replies: 7
    Last Post: 07-02-2015, 04:07 PM
  2. Load PNG File in Userform Image Control
    By Tony in forum Excel Help
    Replies: 2
    Last Post: 02-14-2013, 01:21 PM
  3. #Value Error in Working File
    By Suhail in forum Excel Help
    Replies: 2
    Last Post: 11-19-2012, 11:39 PM
  4. Swapping columns Error 2
    By jomili in forum Excel Help
    Replies: 1
    Last Post: 11-16-2012, 08:52 PM
  5. Excel Error
    By aarbuckle in forum Excel Help
    Replies: 5
    Last Post: 03-13-2012, 03:12 AM

Posting Permissions

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