Share via

Copypicture method range class failed

Anonymous
2016-06-14T06:00:53+00:00

i'm using a excel where it copies the range of cells and displays it in a userfrom. it works fine in my pc but when i try to run the same file in the other systems works fine fine in the first iteration after that it shows the error of 1004 : Copypicture method range class failed. Any suggestions??

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2016-06-14T09:46:03+00:00

    Hi Bhushan,

    Worksheets("Sheet3").Range("L5:S18").CopyPicture xlScreen, xlBitmap

    I can see nothing problematic with the syntax of your implementation of the Range.CopyPicture method and I am unable to replicate your error. I am aware of an old bug with the Range.CopyPicture under Excel 2007, when the value xlPicture is assigned as the format value, but in your case neither condition pertains.

    Additionally, the fact that the code works on the first pass would lead me to look elsewhere for a solution.

    Hopefully, someone else will bee able to respond in a more useful manner.

    ===

    Regards,

    Norman

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-06-14T08:47:52+00:00

    Worksheets("Sheet3").Range("L5:S18").CopyPicture xlScreen, xlBitmap

    Charts("Chart1").Paste

    Application.DisplayAlerts = False

    ThisWorkbook.Save

    fName = "C:\temp.JPEG"

    Charts("Chart1").Export Filename:=fName, FilterName:="JPEG"

    'ActiveChart.Export Filename:=fName, FilterName:="GIF"

    Car.Image1.Picture = LoadPicture(fName)

     With Car.Image1

            .AutoSize = False 'True makes the control expand, not the graphic shrink

            .Height = 450   'Size of image control

            .Width = 550

            .PictureSizeMode = fmPictureSizeModeStretch

     End With

    Im using the same code in 3 different user forms

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-06-14T08:17:07+00:00

    Bhushan,

    i'm using a excel where it copies the range of cells and displays it in a userfrom. it works fine in my pc but when i try to run the same file in the other systems works fine fine in the first iteration after that it shows the error of 1004 : Copypicture method range class failed. Any suggestions?? 

    To improve the possibility of receiving useful responses, try posting the problematic code.

    ===

    Regards,

    Norman

    Was this answer helpful?

    0 comments No comments