Forum Discussion

Sumit_Bhokare's avatar
Sumit_Bhokare
Copper Contributor
Apr 13, 2024

CopyPicture method of Picture Class failed error

Hello All,

I'm facing Run time error 1004 sometime when I run code & sometime code works perfectly.

for few user code run but few user face this issue. earlier it was working fine for all.

when I debug it it breaks at Selection.Copypictue

not sure how to solve it can someone please help.

 

HansVogelaar 

7 Replies

  • Sumit_Bhokare 

    Does it work better if you replace the first 4 lines from your screenshot with

        thisWb.Worksheets("Item Details").Shapes("Picture 1").CopyPicture
    • Sumit_Bhokare's avatar
      Sumit_Bhokare
      Copper Contributor

      HansVogelaar It works well for me but my team member faces issue.

      same thing happened earlier as well. sometimes it works fine, not sure what exactly is issue.

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Sumit_Bhokare 

        As a test, insert the following lines above the CopyPicture line:

         

        Application.CutCopyMode = False

        DoEvents

         

        and below it:

         

        DoEvents

Resources