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.

proteger un libro para que en una fecha determinada excel pida introducir contraseña

publicado

Buenas, desde Gijón-Asturias-Spain,

Disculpad si el tema ya ha sido resuelto, hay tanta información que me resulta imposible localizarlo.

Es posible proteger un libro para que en una fecha determinada excel pida introducir contraseña?

Saludos

Lobato

Featured Replies

publicado

Que tal @José Lobato Castaño

Se me ocurre algo así:

Option Explicit

Private Sub Workbook_Open()
    Application.EnableEvents = True
    If Hoja2.Range("c2") = Hoja2.Range("B2") Then
    Hoja2.Protect "123abc"
     Call Desproteger
    End If
End Sub
Sub Desproteger()
Dim Contraseña As String
    Contraseña = InputBox("Introduce la Clave", "Password")
        If Contraseña <> "123abc" Then
                MsgBox "Contraseña Incorrecta"
                Application.DisplayAlerts = False
                ThisWorkbook.Save
                ThisWorkbook.Close
            Exit Sub
            Else
            Hoja2.Unprotect "123abc"
            End If
End Sub

Saludos

Libro1.xlsm

  • 2 weeks later...
publicado
  • Autor

Estimado DiegoLG, siento la demora en darte las gracias, heestado fuera de España estos dñias.

Tus instrucciones parece funcionar, al abrir tu ejemplo la fecha, Hoy(), es superior a la de caducidad y pide contraseña pero si cambio la fecha, a mano, de hoy() a una más pequeña que la de caducidad me sigue pidiendo contraseña.

Además si añado una segunda macro para otra función como incrementar un contador, o cualquier otra instrucción siempre me da error de compilación.

Disculpa mi ignorancia.

Saludos

Lobato

image.thumb.png.7e6a67a648a74c62b1e04a55057ed14b.png

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.