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.

Cuando agrego los datos del formulario a la hoja de Excel

publicado

Buenas noches,

acabo de terminar de hacer un formulario que me permite agregar y modificar los productos pero cuando le doy clic en el botón que me permite agregar dichos artículos me lanza el siguiente error y si presiono depurar o finalizar el Excel me deja de funcionar y se cierra.

image.png.18440b34d69fa9b1d0bd61633290277f.png

Este es el código del botón.

image.thumb.png.169f19ad56ba19ea142d71b36ff6550c.png

Espero me puedan ayudar ,muchas gracias de antemano.

PROYECTO.xlsm

Featured Replies

publicado

Pienso que el archivo que has compartido puede estar corrupto después de las pruebas realizadas

publicado

Cuando se usa  .RowSource, hay que ir con mucho cuidado a la hora de modificar las celdas que componen el rango asociado, ya que se actualiza el listbox/combobox y se desencadenan todos los eventos asociados al control y se acaba haciendo de "la picha un lio".

Para evitar esto debemos borrar la propiedad .RowSource antes de añadir/modificar cualquier celda del rango y posteriormente, como ya haces, volver a cargar el control.

Private Sub bt_agregar_Click()
Dim pro As Integer
If txt_ean.Value = "" Or txt_material.Value = "" Or txt_descripcion.Value = "" Or cmb_categoria.Value = "" Or cmb_proveedor.Value = "" Or txt_peso.Value = "" Then
MsgBox ("INFORMACION SIN INGRESAR")
Else
pro = 1
While Worksheets("Base Productos").Range("A" & pro) <> ""
pro = pro + 1
Wend

Me.lista.RowSource = "" '<-----------------------------------------------
                                                                                                     
Worksheets("Base Productos").Range("A" & pro) = Me.txt_ean.Value
Worksheets("Base Productos").Range("B" & pro) = Me.txt_material
Worksheets("Base Productos").Range("C" & pro) = Me.txt_descripcion
Worksheets("Base Productos").Range("D" & pro) = Me.cmb_categoria
Worksheets("Base Productos").Range("E" & pro) = Me.cmb_proveedor
Worksheets("Base Productos").Range("F" & pro) = Me.txt_cantidad.Value
'End If
Me.lista.RowSource = "Productos"
Me.lista.ColumnCount = 13
'Resume Next
End Sub

 

Editado el por Antoni

publicado

Yo no he podido ni abrir el archivo, no sé, luego cuando llegue a casa pruebo en mi ordenador, a ver si es problema de este en concreto.

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

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.