SOLVED

EXCEL CLOSE WHEN DONT FIND IMAGE

Copper Contributor

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

 

4 Replies
best response confirmed by WLLIAN (Copper Contributor)
Solution

@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.

@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?

 

 

WLLIAN_0-1727616716658.png

 

@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.

@Harun24HR  its true. I put the name of "imagen2" ... so when i run the code... the botton don't arase now.
Dude... you are awesome. Really.

Thank your your time.

1 best response

Accepted Solutions
best response confirmed by WLLIAN (Copper Contributor)
Solution

@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.

View solution in original post