Forum Discussion

WLLIAN's avatar
WLLIAN
Brass Contributor
Sep 29, 2024

EXCEL CLOSE WHEN DONT FIND IMAGE

Hi, i have a file that load multiple image by name on a column.

But when don't find the image file... the file close him self.

The file and the folder with the images are in the same place.

There a way to stop that? I try use On error resume next, but the error continues...


Windows
excel 365

64

 

  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor

    WLLIAN To avoid this situation you can check if the file exist or not. Use DIR() function to check it.

    If Dir(rutacompleta) <> "" Then

     See the attached file for full codes.

    • WLLIAN's avatar
      WLLIAN
      Brass Contributor

      Harun24HRIt works!! Perfect! Thank you.

      The botton who actives the code erase after is complete, i notice now.

      There's a way to not arase him after run the code?

       

       

       

      • Harun24HR's avatar
        Harun24HR
        Bronze Contributor

        WLLIAN Glad to know it helps. In your there is a name of shape which will not be deleted. So, rename your command button name as per name in code. I can't check that name right now as I am writing from mobile.

Resources