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.

Desbloquear hoja

publicado

Buenos días,

A ver si me pueden ayudar. Con el siguiente codigo consigo desbloquear las hojas de Excel. Pero me gustaría, y no lo consigo, generar un código que al crear un archivo alguien intenta desbloquearlo con esta macro por ejemplo, le pida una contraseña.

Por ejemplo, le paso un libro bloqueado a un amigo e intenta desbloquear con este código, y Excel al intentar acceder a la propiedad esta le pida una clave nueva. ¿Es posible?

Muchas gracias de antemano.

Sub breakit()

' Después de terminar el proceso muestra un mensaje con la contraseña correcta.

Dim i As Integer, j As Integer, k As Integer

Dim l As Integer, m As Integer, n As Integer

On Error Resume Next

For i = 65 To 66

For j = 65 To 66

For k = 65 To 66

For l = 65 To 66

For m = 65 To 66

For i1 = 65 To 66

For i2 = 65 To 66

For i3 = 65 To 66

For i4 = 65 To 66

For i5 = 65 To 66

For i6 = 65 To 66

For n = 32 To 126

ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _

Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _

Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

If ActiveSheet.ProtectContents = False Then

MsgBox "Utiliza la siguiente contraseña para desbloquear la hoja: " & Chr(i) & Chr(j) & _

Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) _

& Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

Exit Sub

End If

Next

Next

Next

Next

Next

Next

Next

Next

Next

Next

Next

Next

End Sub

Featured Replies

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.