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.

No soy capaz de pasar el parámetro

publicado

Hola a todos y todas;

-A ver si me podéis echar un cable.

Estoy intentado pasar el nombre del formulario por parámetro a un procedimiento que tengo en un módulo y me genera error y no sé porque.

Si la macro la ejecuto desde la subrutina del formulario va bien en cambio desde el módulo no va y no sé porque.

Sub EnviarHojaActiva(vForm As UserForm) 'Sub EnviarHojaActiva(UserForm1 As UserForm) <---Tampoco va
Dim RutaTemporal As String, NombreArchivo As String


Application.ScreenUpdating = False
Application.DisplayAlerts = False

NombreArchivo = ActiveSheet.Name
RutaTemporal = VBA.Environ("temp") & "\"
NombreArchivo = RutaTemporal & NombreArchivo & ".xlsx"

    ActiveWorkbook.ActiveSheet.Copy
    ActiveWorkbook.SaveAs NombreArchivo

    vForm.txtAdjunto = NombreArchivo

    ActiveWorkbook.Close False
    
On Error GoTo 0

Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub

Adjunto macro por si acaso.

Tengo otras macros donde uso 

Cita

Sub Macroxxxx(Mixxxx As UserForm, vFila As Integer)

y sí me va.

¿?

 

MHActiva.xlsm

Featured Replies

publicado

Cuando llamas al procedimiento, no le pongas coma...

Pusiste:  EnviarHojaActiva , Me

Debe ser: EnviarHojaActiva  Me

 

publicado
  • Autor
Hace 11 minutos , DiegoPC dijo:

Cuando llamas al procedimiento, no le pongas coma...

Pusiste:  EnviarHojaActiva , Me

Debe ser: EnviarHojaActiva  Me

 

Hola y gracias Diego, maldita coma, nos hacemos mayores y hay que empezar a poner gafas.????????‍♂️

 

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.