Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por denisluan
#47369
Esta macro puxa a imagem do produto em um Form. As imagens ficam em uma pasta separada.
Porém, alguns produtos não possuem imagem, gostaria que o objeto de imagem do Form (imFoto) retornasse nada, ou seja sem foto, porém quando não encontra um arquivo de imagem está dando erro.


Private Sub cdDT_Change()

Dim imagem
Set endereco = Range("R1")
ultimalinha = Planilha1.Cells(Planilha1.Cells.Rows.Count, "b").End(xlUp).Row

For i = 7 To ultimalinha

If Cells(i, 2) = CDbl(cdDT) Then
cdData = Cells(i, 3)
cdTransportadora = Cells(i, 4)
imagem = endereco & Cells(i, 6)

Set imFoto.Picture = LoadPicture(imagem)
imFoto.PictureSizeMode = fmPictureSizeModeZoom
End If

Next

End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord