ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Modal Userform and Preview on Screen (https://www.excelbanter.com/excel-programming/352252-modal-userform-preview-screen.html)

Jos Vens[_2_]

Modal Userform and Preview on Screen
 
Hi,

I have made my own Print dialog (a modal userform) with a button Preview on
it. Now, I test it out and the userform stays in front of the (background)
printpreview. There is no way to get out of this, unless resetting my
computer. Is there a way to get out of this situation without losing my
code? (I know I had to hide the userform but I forgot!)

Thanks
Jos Vens



Leith Ross[_528_]

Modal Userform and Preview on Screen
 

Hello Jos,

To hide the from: UserForm1.Hide

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=507921


Jos Vens[_2_]

Modal Userform and Preview on Screen
 
Hi Leith,

If you read my question well, I know you have to hide the form, but what if
you didn't? Is the code gone? Can you still get it in any way? eg. you did
not save your code for a couple of hours... is it lost?

Jos


"Leith Ross"
schreef in bericht
...

Hello Jos,

To hide the from: UserForm1.Hide

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=507921




Mark Lincoln

Modal Userform and Preview on Screen
 
Can you click the Close box at the upper right on the form? Gets rid
of the form and stops its code.


Jos Vens[_2_]

Modal Userform and Preview on Screen
 
No, you can't do nothing, neither in excel, nor in vba: everything is
blocked until you close the preview screen, but you can't close it because
the upper form is modal. Even Ctrl-Break does not work, but maybe a
key-combination that I don't know works to get rid of either the preview
window, or the modal form.

Jos

"Mark Lincoln" schreef in bericht
oups.com...
Can you click the Close box at the upper right on the form? Gets rid
of the form and stops its code.




Mark Lincoln

Modal Userform and Preview on Screen
 
How about Ctrl-Alt-Del to get to the Task List? With luck, you can
close the preview (if its process is listed separately) without closing
Excel.


Jos Vens[_2_]

Modal Userform and Preview on Screen
 
Hi Mark,

I tried it but what process do I have to kill? I killed a dozen of processes
but then I stopped trying.

Thanks
Jos


"Mark Lincoln" schreef in bericht
oups.com...
How about Ctrl-Alt-Del to get to the Task List? With luck, you can
close the preview (if its process is listed separately) without closing
Excel.




Mark Lincoln

Modal Userform and Preview on Screen
 
With hindsight, I suspect that all the activity is within Excel itself.
I'm sorry, but I would not be hopeful that you could recover your
work. On the other hand, by now you should have been able to rewrite
everything.

This illustrates something that I've learned the hard way (I've been
down this road before): Work on a copy when possible, and always Save
before testing.


Jos Vens[_2_]

Modal Userform and Preview on Screen
 
Hi Mark,

thank you for confirming what I already thought. I am programming since 2000
in VBA and was down that road before too! Problem is that sometimes, you
make a mistake (you go to fast...) and it would be a pitty if you shouldn't
know there is a solution to get out...

I cannot save everytime I go to runtime environment since it costs me more
than a minute. So I save from time to time.

Regards,
Jos

"Mark Lincoln" schreef in bericht
oups.com...
With hindsight, I suspect that all the activity is within Excel itself.
I'm sorry, but I would not be hopeful that you could recover your
work. On the other hand, by now you should have been able to rewrite
everything.

This illustrates something that I've learned the hard way (I've been
down this road before): Work on a copy when possible, and always Save
before testing.




Mark Lincoln

Modal Userform and Preview on Screen
 
I cannot save everytime I go to
runtime environment since it costs
me more than a minute. So I save
from time to time.


The trick is knowing when you'll get an error you can't recover from,
and save just before that happens. But for me, it seems that the
surest way to produce an unrecoverable error is to not save. :)



All times are GMT +1. The time now is 05:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com