View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Userform show / hide problem

I would next try putting a procedure in File1 that shows the userform.

Then in the button code of File2, have it do an Application.Ontime to run
that procedure just before it closes

Application.OnTime Now+timevalue("00:00:01"),"File2.xls!ShowMyForm"
ProdWorkbook.Close savechanges:=False



--
Regards,
Tom Ogilvy
..
"brookly" wrote in message
oups.com...
Yeah! So close!!

This works great when I close file2 with the small "x". The problem
with that is that I have a macros running to eliminate toolbars when
the userform shows (just for presentation sake). When the user clicks
the command button in file1userform that sends them to file2, I reset
the toolbars. I have added a command button directly onto file2
spreadsheet that I want to "clear all" toolbars and close file2 without
saving changes. When I use that command button to close file2 instead
of the "x", my userform does not show again in file1 which is still
open.

Here is the code on the command button in file2.

Private Sub CommandButton1_Click()
'ClearAll runs a macros to eliminate toolbars and unsightly excel
background
ClearAll
ProdWorkbook.Close savechanges:=False
End Sub

What am I missing?

P.S. You're saving my life!