Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hola soy nuevo en condigo VBA tengo un codigo que me ingresa una foto de una carpeta dentro de una autoforma circular pero si no hay fotos me da error

publicado

Me explico el codigo funciona muy bien, me busca las formas y las rellena con una foto de una carpeta, el problema viene cuando se agrega un nuevo registro de persona nueva y no haya foto aun, me da un error y no ejecuta la macro me podrian ayudar a corregir el codigo por favor para que cuando no encuentre una foto de una persona nueva inserte una foto que diga no hay foto.
este es mi codigo actual


Set Autoforma = Hoja28.Shapes("_cFila" & Indice) 'Circulo de las fotos

With Autoforma

.Left = Hoja28.Cells(Indice + 11, DiaMin + 12 - 1).Left 'Comienza en la columna 12 -1 para que comience desde el borde

NombreImagen = Mid(Empleado.Value, 1, InStr(1, Empleado.Value, " ") - 1) & ".png"

RutaImagen = ActiveWorkbook.Path & Application.PathSeparator & "Fotos" & Application.PathSeparator & NombreImagen

.Fill.UserPicture RutaImagen

.Visible = msoTrue

End With

Solucionado por jojanu54

Ir a la solución

Featured Replies

publicado
.....
If Not Dir(RutaImagen) = "" Then
	.Fill.UserPicture RutaImagen
	.Visible = msoTrue
End If
.....
publicado
  • Autor
  • Solución
hace 2 horas, Antoni dijo:
.....
If Not Dir(RutaImagen) = "" Then
	.Fill.UserPicture RutaImagen
	.Visible = msoTrue
End If
.....

Maestro muchas gracias, me funciono a la perfección, eres un genio

Crear una cuenta o conéctate para comentar

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.