Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Como maximizar formulario Excel al iniciar


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

Me preguntan en un foro, como maximizar un formulario de Excel al iniciar, este post responde la pregunta como maximizar un formulario de VBA de Excel al iniciar, al maximizarse queda la aplicación de Excel oculta; si requieres minimizar un formulario de Excel sigue el link; en post anteriores se presentaron otras macros que trabajan con formularios como son: como eliminar el botón X o cerrar de un formulario, como eliminar la barra de titulos de los formularios de VBA, como anular o inutilizar el botón cerrar o X de un formulario de Excel, como agregar un botón maximizar y minimizar en la barra de titulos de un formulario de Excel.

Recomiendo leer un excelente libro sobre Excel que te ayudará operar las planillas u hojas de cálculo, haz click acá, si quieres aprender sobre Excel, en inglés, entonces debes hacer click here. Si lo que necesitas es aprender o profundizar sobre la programación de macros con VBA este es unos de los mejores cursos on line que he visto en internet.

  
El ejemplo que se puede descargar desde el final del post, permite maximizar un formulario al iniciar, en otras palabras cuando el código de VBA llama o carga el formulario, directamente aparece maximizado.

El ejemplo también incluye en el formulario los botones maximizar y minimizar, ya que de lo contrario no habría otra forma de volver el formulario al estado original, quedando como única alternativa cerrar, para salvar este inconveniente se agregan los botones de maximizar y minimizar para mostrar el formulario maximizado, minimizado o en tamaño original.

El vídeo que sigue muestra una explicación más detallada mostrando el funcionamiento de la macro presentada, recomiendo observar para una más fácil comprensión de la macro; suscribe a nuestra web desde la parte superior derecha de la página ingresando tu mail y a nuestro canal de You Tube para recibir en tu correo vídeos explicativos sobre macros interesantes, como  por ejemplo como crear cartas en Word desde Excelbuscar en listbox mientras escribes en textbox, como ingresar solo texto en textboxconectar Excel con Access, libro con url de todas las macros de esta web con buscador incluido y cientos de ejemplos.

function onYtEvent(payload) {
if (payload.eventType == ‘subscribe’) {
// Add code to handle subscribe event.
} else if (payload.eventType == ‘unsubscribe’) {
// Add code to handle unsubscribe event.
}
if (window.console) { // for debugging only
window.console.log(‘YT event: ‘, payload);
}
}

 

Código que se inserta en un formulario
Option Explicit
Private Declare Function FindWindow Lib «user32» Alias «FindWindowA» (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function DrawMenuBar Lib «user32» (ByVal hwnd As Long) As Long
Private Declare Function SetWindowLong Lib «user32» Alias «SetWindowLongA» (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib «user32» Alias «GetWindowLongA» (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const WS_MINIMIZEBOX As Long = &H20000
Private Const WS_MAXIMIZEBOX As Long = &H10000
Private Const GWL_STYLE As Long = (-16)
Private Declare Function ShowWindow Lib «user32» (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const maxformvba = 3
Dim hh As Long

Private Sub CommandButton1_Click()
ShowWindow hh, maxformvba
End Sub
Private Sub UserForm_Activate()
ShowWindow hh, maxformvba
End Sub

Private Sub UserForm_Initialize()
    Dim lngMyHandle As Long, lngCurrentStyle As Long, lngNewStyle As Long
    If Application.Version < 9 Then
        lngMyHandle = FindWindow(«THUNDERXFRAME», Me.Caption)
    Else
        lngMyHandle = FindWindow(«THUNDERDFRAME», Me.Caption)
    End If
    lngCurrentStyle = GetWindowLong(lngMyHandle, GWL_STYLE)
    lngNewStyle = lngCurrentStyle Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
    SetWindowLong lngMyHandle, GWL_STYLE, lngNewStyle
hh = FindWindow(vbNullString, Me.Caption)
End Sub



Código que se inserta en un módulo


Sub muestra()
UserForm1.Show
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 (78)

If you wish for to get a great deal from this paragraph then you have to
apply these techniques to your won webpage.

Responder

I feel that is one of the such a lot important info for me.
And i am glad studying your article. But want to observation on some normal issues, The website taste is great,
the articles is in reality nice : D. Good activity, cheers

Responder

Appreciate the recommendation. Let me try it out.

Responder

Heya i’m for the first time here. I came across this
board and I in finding It really useful & it helped me out
much. I am hoping to offer something again and aid others like you aided me.

Responder

Hi i am kavin, its my first time to commenting anywhere, when i read this piece of writing i thought i could also create comment due to this good article.

Responder

I visited multiple blogs but the audio feature for audio
songs existing at this website is in fact marvelous.

Responder

Howdy! I could have sworn I’ve been to this blog before
but after reading through some of the post I realized it’s new to me.
Anyhow, I’m definitely delighted I found it and I’ll be bookmarking and
checking back often!

Responder

Everything is very open with a precise clarification of
the issues. It was really informative. Your site is useful.
Thank you for sharing!

Responder

Admiring the dedication you put into your site and detailed information you present.

It’s nice to come across a blog every once in a while that isn’t the same out of date rehashed material.
Excellent read! I’ve bookmarked your site and I’m including your RSS feeds to my Google account.

Responder

Actually when someone doesn’t be aware of after that its up to other viewers that they will help, so here
it takes place.

Responder

Quality posts is the crucial to invite the users to pay a visit the site,
that’s what this site is providing.

Responder

Howdy just wanted to give you a quick heads up and let you know
a few of the pictures aren’t loading correctly.
I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers and both show the same outcome.

Responder

Penentu Kemenangan Di Website Poker Online selamanya menyingkirkan dunia serta berubah menjadi satu
diantara permainan kartu feature ini hari. Ketika mode permainan bisa berjalan bertambah gampang ketimbang ragam lain dari permainan kartu.

Lantaran pengaplikasian aliran online buat permainan akses,
pun juga permainan menarik dapat dilaksanakan dengan gunakan mobile phone pribadi buat
setiap member. Jadi, seluruh game tambah lebih cepat di track serta mudah buat terhubung cek kupasannya di website poker paling diandalkan sama
yang anda kehendaki seluruh member taruhan.

Responder

Everyone loves what you guys are usually up too.
This sort of clever work and exposure! Keep up the superb works
guys I’ve you guys to blogroll.

Responder

These are truly wonderful ideas in regarding blogging.
You have touched some nice points here. Any way keep up wrinting.

Responder

I am curious to find out what blog platform you’re utilizing?
I’m having some minor security issues with my latest website and I would like to find something more safeguarded.
Do you have any recommendations?

Responder

Excellent way of telling, and nice paragraph to take facts about
my presentation subject, which i am going to deliver in college.

Responder

With havin so much content do you ever run into any issues of plagorism or copyright violation? My
site has a lot of unique content I’ve either written myself
or outsourced but it appears a lot of it is popping
it up all over the internet without my agreement. Do you know any ways to help protect against content
from being ripped off? I’d really appreciate it.

Responder

What’s up, after reading this remarkable paragraph i am as well happy to share my knowledge here with colleagues.

Responder

Hey there just wanted to give you a brief heads up and let you know a few
of the images aren’t loading properly. I’m not sure why but
I think its a linking issue. I’ve tried it in two
different web browsers and both show the same outcome.

Responder

Awesome article.

Responder

This is a topic which is near to my heart…
Thank you! Exactly where are your contact details though?

Responder

This is really interesting, You’re a very skilled blogger.
I’ve joined your rss feed and look forward to seeking more of your magnificent post.
Also, I have shared your site in my social networks!

Responder

I blog frequently and I truly thank you for your information. This great article has really peaked my interest.
I am going to bookmark your blog and keep checking
for new information about once per week. I opted in for your Feed as well.

Responder

I was curious if you ever thought of changing the page layout of your
website? Its very well written; I love what youve got to say.

But maybe you could a little more in the way of content so people could connect
with it better. Youve got an awful lot of text for only having
1 or 2 pictures. Maybe you could space it out better?

Responder

This is my first time pay a visit at here and i am really impressed to read everthing at alone place.

Responder

We stumbled over here by a different page and thought I should check things out.
I like what I see so now i am following you. Look forward to looking into your web page again.

Responder

WOW just what I was searching for. Came here by
searching for 창원오피

Responder

Pretty section of content. I just stumbled upon your blog
and in accession capital to assert that I acquire actually enjoyed account your blog posts.
Any way I will be subscribing to your feeds and even I achievement you access consistently fast.

Responder

I just like the helpful information you supply on your articles.

I will bookmark your blog and take a look at again right
here frequently. I am slightly sure I will be informed many new stuff proper right here!
Best of luck for the following!

Responder

I am really enjoying the theme/design of your blog.
Do you ever run into any web browser compatibility problems?
A number of my blog visitors have complained about my blog
not working correctly in Explorer but looks great in Safari.

Do you have any suggestions to help fix this issue?

Responder

Hey there! I’ve been following your site for a long time now and finally
got the courage to go ahead and give you a shout out from Lubbock Tx!
Just wanted to mention keep up the excellent work!

Responder

This site was… how do you say it? Relevant!!
Finally I’ve found something which helped
me. Thank you!

Responder

My spouse and I stumbled over here from a different web address and thought I might as well check things out.
I like what I see so now i am following you. Look forward to finding out about your web page again.

Responder

I enjoy looking through a post that will make men and women think.
Also, thank you for permitting me to comment!

Responder

It’s going to be ending of mine day, except before ending
I am reading this impressive paragraph to improve my experience.

Responder

It’s not my first time to pay a visit this site, i am visiting this web page dailly and
obtain pleasant facts from here all the time.

Responder

I got this site from my friend who shared with me about this web page and at the
moment this time I am visiting this website and reading very informative articles or reviews here.

Responder

I go to see daily some websites and websites to read posts, except this
weblog gives feature based content.

Responder

Appreciating the dedication you put into your blog and in depth
information you present. It’s good to come across
a blog every once in a while that isn’t the
same outdated rehashed material. Excellent read!
I’ve saved your site and I’m adding your RSS feeds to my Google
account.

Responder

Great weblog here! Also your website a lot up very fast!
What web host are you the usage of? Can I am getting your associate hyperlink to your host?
I want my web site loaded up as fast as yours lol

Responder

Your method of telling all in this post is actually good,
all be able to effortlessly know it, Thanks a lot.

Responder

Thanks very nice blog!

Responder

Whoa! This blog looks exactly like my old one!
It’s on a completely different subject but it has pretty much the same layout and design. Great choice of colors!

Responder

Thanks on your marvelous posting! I definitely enjoyed reading it,
you might be a great author.I will make certain to
bookmark your blog and will eventually come back very soon. I want
to encourage you to continue your great job, have a nice day!

Responder

Its like you read my mind! You appear to know so much about this,
like you wrote the book in it or something. I think that you could do with
a few pics to drive the message home a bit, but instead of that, this is fantastic blog.
A fantastic read. I will certainly be back.

Responder

Hi there to every one, the contents existing at this site
are truly remarkable for people knowledge, well, keep up the nice work fellows.

Responder

Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your site?
My blog is in the exact same niche as yours and my users would
really benefit from some of the information you provide here.
Please let me know if this alright with you. Cheers!

Responder

Heya! I just wanted to ask if you ever have any trouble with
hackers? My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no backup.
Do you have any solutions to protect against hackers?

Responder

I read this paragraph fully about the comparison of newest and earlier
technologies, it’s awesome article.

Responder

Hello! I’m at work browsing your blog from my new iphone 4!
Just wanterd to say I love reading through your blog and look forward to
all your posts! Carry on the superb work!

Responder

I wanted to thank you for this very good read!!
I definitely enjoyed every little bit of it. I have you saved as a favorite to
look at new stuff you post…

Responder

I have been exploring for a little bit for
any high quality articles or weblog posts in this sort of area .
Exploring in Yahoo I eventually stumbled upon this website.

Reading this information So i am satisfied to show that I’ve a very just
right uncanny feeling I discovered just what I needed.

I most indubitably will make certain to do not forget this site and provides it a glance on a constant basis.

Responder

This design is spectacular! You certainly know how to keep a reader entertained.
Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent
job. I really loved what you had to say, and more than that, how you presented it.
Too cool!

Responder

I am regular visitor, how are you everybody? This post posted at this website is in fact good.

Responder

Appreciation to my father who informed me concerning this blog,
this website is genuinely amazing.

Responder

Good day! I simply want to give you a big thumbs up for the great information you have got right here
on this post. I am returning to your web site for
more soon.

Responder

Wonderful post! We are linking to this particularly great article on our website.
Keep up the good writing.

Responder

all the time i used to read smaller posts which also clear their
motive, and that is also happening with this piece of writing which I am reading at
this place.

Responder

Great site. Lots of useful information here. I am sending it to several buddies ans also
sharing in delicious. And obviously, thank you in your effort!

Responder

What’s up friends, its fantastic article concerning tutoringand completely explained, keep it
up all the time.

Responder

It’s going to be end of mine day, but before finish I am reading this fantastic paragraph to improve my know-how.

Responder

Great items from you, man. I’ve keep in mind
your stuff prior to and you’re simply too excellent.
I actually like what you have obtained here, certainly like what you are stating and the way in which through which you say it.
You’re making it enjoyable and you continue to take care of to
stay it sensible. I can not wait to read far more from you.
That is actually a terrific site.

Responder

I have learn a few just right stuff here. Certainly worth bookmarking for revisiting.
I surprise how much effort you place to create this type of great
informative website.

Responder

This is really interesting, You are a very skilled blogger.
I have joined your rss feed and look forward to seeking more of your wonderful post.
Also, I have shared your website in my social networks!

Responder

I’m not sure where you’re getting your information, but great topic.
I needs to spend some time learning more or understanding
more. Thanks for fantastic info I was looking for this information for my mission.

Responder

This website was… how do you say it? Relevant!!

Finally I’ve found something which helped me.

Cheers!

Responder

This piece of writing will assist the internet people
for creating new web site or even a blog from start to end.

Responder

WOW just what I was looking for. Came here by searching for 바카라 규칙

Responder

Excellent post. I was checking continuously this blog and I am impressed!
Very helpful information specifically the last part 🙂 I care for such info
a lot. I was seeking this particular info for a long time.

Thank you and good luck.

Responder

I’m really enjoying the theme/design of your weblog.
Do you ever run into any browser compatibility issues?
A few of my blog readers have complained about my site not working correctly in Explorer but looks great
in Opera. Do you have any tips to help fix this problem?

Responder

Spot on with this write-up, I honestly believe that this
web site needs a great deal more attention. I’ll probably be
returning to read more, thanks for the info!

Responder

I’ve been browsing online greater than 3 hours today,
yet I never found any interesting article like yours. It is pretty
worth sufficient for me. In my opinion, if all website owners and bloggers made good content material
as you probably did, the web will probably be a lot more helpful than ever before.

Responder

Hey! This is my 1st comment here so I just wanted to give a quick shout out and say
I really enjoy reading your blog posts. Can you recommend any other blogs/websites/forums that go over
the same subjects? Thank you!

Responder

Right here is the perfect site for anyone who hopes to understand this topic.
You understand a whole lot its almost hard to argue with you (not
that I personally will need to…HaHa). You certainly put a new spin on a subject that’s been discussed
for many years. Wonderful stuff, just excellent!

Responder

I love your blog.. very nice colors & theme. Did you create this website yourself
or did you hire someone to do it for you? Plz reply as I’m looking to design my own blog and
would like to find out where u got this from.

thanks

Responder

Attractive component of content. I just stumbled upon your blog
and in accession capital to claim that I get in fact enjoyed account your weblog posts.
Anyway I will be subscribing to your feeds and even I fulfillment you
access consistently fast.

Responder

This is a good tip particularly to those new to the blogosphere.
Brief but very accurate information… Thanks for sharing this one.
A must read post!

Responder