Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Recuperar Password o Contraseña de hoja bloqueada

En un anterior pos se había expuesto una macro que crea un formulario que solicita password de acceso, ahora voy a mostrar como recuperar un password o contraseña de una hoja bloqueada o desbloquear hoja de excel; en desbloquear un proyecto de VBA se expone como desbloquear o recuperar clave de proyecto de VBA; es muy normal que por una cuestión de privacidad o seguridad se bloqueen las hojas, ya sea para que no se puedan ingresar nuevos datos o para que no se eliminen accidental o intencionalmente fórmulas o formatos.

Sucede que en muchas ocasiones se nos olvida el password o clave, con el consiguiente problema que no podemos modificar la hoja, entonces tenemos que ingresar de nuevo los datos, las fórmulas y aplicar los formatos que teníamos antes a los fines de rehacer la hoja, a pesar que nos lleva el doble de trabajo, esto no es problema cuando se trata de hojas simples; pero que sucede con planillas complejas sería muy trabajoso volver a realizar la hoja nuevamente, para ello y dar una solución te muestro esta macro que recupera el password o contraseña de hojas bloqueadas o protegidas.

Antes de seguir con el desarrollo y en el caso que no tengas conocimiento suficiente sobre el manejo de hojas de Excel, te recomiendo antes de introducirte en el mundo de las macros, que leas un excelente libro sobre Excel el que te ayudará manejar las planillas de cálculo, debes hacer click acá, si quieres un libro sobre Excel, en inglés, entonces debes hacer click acá.

MASTERCARD PAYONEER

Este ejemplo de macro o procedimiento de VBA que recupera password funciona de una manera muy sencilla, desde el link del final se puede descargar el archivo de ejemplo, de esta manera podrás ver su funcionamiento en forma más detallada.

El código de VBA o Macro de Excel que recupera password de hoja bloqueada se debe ingresar en un módulo, posicionarse en la hoja bloqueada y ejecutar la macro; en este ejemplo la hoja1 se encuentra bloqueada con el clave«1234» si se intenta modificar sale un letrero que no se puede, porque se encuentra bloqueada, para desbloquearla hay que ingresar el password, si no se recuerda el contraseña se tiene un problema que con esta macro se soluciona, lo que se debe hacer es ejecutar la macro denominada «DesprotegerHoja», corriendo un código que determina un password alternativo y por ende desbloquea la hoja dejando de esta manera la hoja de Excel accesible como si no tuviera clave, en otras palabras elimina la clave.

En el caso que seas principiante en el tema de las macros, lo que debes hacer es presiona Alt + F11, con ello se inicia el Editor de Visual Basic; posteriormente se debe insertar un módulo y pegar el código que se encuentra más abajo o en el archivo de ejemplo que descargues de esta página; luego te posicionas en la hoja que deseas desbloquear y ejecutas la macro.

La macro la puedes correr desde la ficha programador, seguidamente haz click en menú y luego en macros; o desde el Editor de Visual Basic; seleccionas el módulo donde esta el código de VBA, luego debes seleccionar la macro «DesprotegerHoja», según se muestra en la imagen;

Si no tienes habilitado la ficha programador en Excel, debes hacerlo desde «Archivo», luego «Opciones de Excel», posteriormente seleccionar «Personalizar cinta de Opciones» y tildar el menú programador en la parte derecha del formulario (ver la imagen anterior); luego de estos pasos quedará habilitado el menú programador pudiendo ejecutar macros desde dicho menú, para este caso seleccionar la macro «DesprotegerHoja».

Básicamente esta macro recupera el password, clave o contraseña de una hoja bloqueada, o desbloquear hoja de excel, como prefieras denominarlo; en otras palabras determina una clave alternativa y con ella desbloquea la hoja solucionando el problema del olvido de la clave de desbloqueo de la hoja de Excel. En el link del final podrás descargar el ejemplo y adaptarlo a lo que necesites.

Este código se debe usar con cuidado, en el sentido de que no está hecho para violar archivos sobre los cuales no se tiene el derecho de uso o propiedad del mismo, el fin de este código es poder desbloquear hojas de las cuales no recordamos la contraseña, password o clave de hojas de archivos o ficheros de los cuales tengamos el derecho de autor o uso de los mismos.

Código que se inserta en un módulo

Sub DesprotegerHoja()
On Error Resume Next
Dim a, b, c, d, e, f, g, h, i, j, k, l As Integer
Dim freepass
For a = 65 To 66: For b = 65 To 66: For c = 65 To 66
For d = 65 To 66: For e = 65 To 66: For f = 65 To 66
For g = 65 To 66: For h = 65 To 66: For i = 65 To 66
For j = 65 To 66: For k = 65 To 66: For l = 32 To 126

freepass = Chr(a) & Chr(b) & Chr(c) & Chr(d) & Chr(e) & Chr(f) _
& Chr(g) & Chr(h) & Chr(i) & Chr(j) & Chr(k) & Chr(l)
ActiveSheet.Unprotect freepass

    

If ActiveSheet.ProtectContents = False Then
MsgBox «Su hoja fue desprotegida correcatamente, el password alternativo fue: » & freepass, vbInformation, «****FREEPASS http://programarexcel.com****»
Exit Sub
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next

End Sub

Si te fue de utilidad puedes INVITARME UN CAFÉ y de esta manera ayudar a seguir manteniendo la página, CLICK para descargar en ejemplo en forma gratuita.


(adsbygoogle = window.adsbygoogle || []).push({});

If this post was helpful INVITE ME A COFFEE and so help keep up the page, CLICK to download free example.

Si te gustó por favor compártelo con tus amigos
If you liked please share it with your friends      

Entradas relacionadas

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Comentarios (36)

Excellent post. I was checking constantly this blog and I’m impressed!
Very useful information specifically the last part 🙂 I care for such information much.
I was seeking this particular info for a long time.

Thank you and good luck.

Responder

This page really has all of the information I wanted about this
subject and didn’t know who to ask.

Responder

I constantly spent my half an hour to read this
blog’s posts daily along with a mug of coffee.

Responder

Just wish to say your article is as astounding.
The clarity in your post is simply spectacular and i could
assume you’re an expert on this subject. Fine with your permission let me to grab your RSS feed to keep updated with
forthcoming post. Thanks a million and please continue the rewarding work.

Responder

Hey fantastic blog! Does running a blog like this take a lot of work?
I have absolutely no knowledge of programming however I had been hoping to
start my own blog soon. Anyways, if you have any suggestions or techniques for new blog
owners please share. I know this is off subject but I simply had to ask.
Kudos!

Responder

If some one desires to be updated with most recent technologies therefore he must be visit this
site and be up to date daily.

Responder

I would like to thank you for the efforts you’ve put in writing this blog.
I really hope to check out the same high-grade content from
you later on as well. In fact, your creative writing abilities has inspired me to get my own blog now 😉

Responder

I’m gone to say to my little brother, that he should also pay a visit this blog on regular basis to get
updated from latest news update.

Responder

I know this if off topic but I’m looking into starting my own blog and was wondering what all is
needed to get setup? I’m assuming having a blog like yours would cost a pretty penny?
I’m not very internet savvy so I’m not 100% certain. Any recommendations or advice would be greatly appreciated.
Thank you

Responder

Why viewers still use to read news papers when in this technological globe everything is accessible on web?

Responder

Hurrah! At last I got a web site from where I can genuinely obtain helpful facts concerning my study and knowledge.

Responder

Great blog here! Also your web site loads up very fast!
What host are you using? Can I get your affiliate link to your host?
I wish my website loaded up as quickly as yours lol

Responder

What’s up Dear, are you genuinely visiting this site daily,
if so afterward you will without doubt get nice experience.

Responder

Howdy, I do think your site could be having
web browser compatibility problems. Whenever
I look at your web site in Safari, it looks
fine however, when opening in IE, it’s got some
overlapping issues. I merely wanted to provide you with a quick heads up!
Other than that, fantastic site!

Responder

My family all the time say that I am wasting my time here at net, except I know I am getting
familiarity daily by reading such pleasant content.

Responder

Hi mates, how is all, and what you desire to say regarding this piece of writing, in my view its truly amazing for me.

Responder

whoah this weblog is wonderful i really like studying your posts. Keep up the good work! You recognize, a lot of people are searching round for this info, you can aid them greatly.

Responder

I visited many sites but the audio quality for audio
songs existing at this web page is genuinely
fabulous.

Responder

Hello, yes this article is genuinely nice and I have learned lot of things from
it regarding blogging. thanks.

Responder

Amazing blog! Is your theme custom made or did
you download it from somewhere? A design like yours with a few simple tweeks would really make my blog jump out.
Please let me know where you got your design. Appreciate it

Responder

I do not know whether it’s just me or if perhaps everybody
else experiencing problems with your site. It seems like
some of the text on your posts are running off the screen. Can someone else please comment
and let me know if this is happening to them as well?
This might be a issue with my web browser because I’ve had this happen before.
Cheers

Responder

Hi, I think your website might be having browser compatibility issues. When I look at your blog site in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, terrific blog!

Responder

Hello there, You’ve done an incredible job. I will definitely digg it and personally suggest to my
friends. I am confident they’ll be benefited from this web
site.

Responder

Hello there, I discovered your blog by the use of Google
even as searching for a similar matter, your web site came up, it
seems to be good. I have bookmarked it in my google bookmarks.

Hello there, just changed into aware of your blog through Google, and
located that it’s really informative. I am going
to be careful for brussels. I will be grateful if you continue this
in future. Many other people might be benefited from your
writing. Cheers!

Responder

It’s genuinely very complicated in this full of activity life to listen news on Television, therefore I simply use world wide web for that reason, and obtain the most
up-to-date information.

Responder

This is a topic that’s close to my heart… Take care! Where are your contact details though?

Responder

Very rapidly this website will be famous amid all blog users,
due to it’s fastidious content

Responder

Quality content is the main to be a focus for the users to go to
see the site, that’s what this website is providing.

Responder

Great post. I was checking continuously this weblog and I’m inspired! Extremely helpful info specifically the final section 🙂 I deal with such information much. I used to be seeking this particular information for a long time. Thanks and good luck.

Responder

I don’t know if it’s just me or if perhaps everybody else experiencing issues with your
site. It appears as if some of the written text on your
posts are running off the screen. Can someone else please provide feedback and let me
know if this is happening to them as well?
This may be a issue with my browser because I’ve had this
happen previously. Kudos

Responder

This is my first time pay a quick visit at here and i am
truly happy to read all at alone place.

Responder

You actually make it seem so easy with your presentation but I to find this topic to be actually one thing that
I believe I would never understand. It sort of feels too complex and very broad for me.
I’m having a look forward for your next post, I will try to get the grasp of
it!

Responder

Hey very interesting blog!

Responder

Great post.

Responder

Pretty element of content. I simply stumbled upon your blog and in accession capital to say that I acquire in fact enjoyed account your blog posts. Any way I’ll be subscribing on your feeds and even I success you get admission to persistently rapidly.

Responder

It’s really a great and helpful piece of info. I am glad that you shared this useful information with us. Please keep us informed like this. Thanks for sharing.

Responder