Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
I have two files. First file runs through a userid/password validation then
gives user a list of files to open on userform. After selection, userform is hidden (me.hide), second file opens. User makes changes, etc. Command button gives user option on second file to close & save changes and reshow the userform on first file to make another selection. After saving changes and closing on second file, userform on first file should be re-shown. My current code does close and save the file, but when focus returns to first file, userform is not visible. Here is code to close second file and return to first file: Private Sub Show_Cost_Center() Application.Run ("HideAll") Return_Cost_Center.Show vbModeless End Sub Here is code on first file to re-show the userform: Private Sub cmbSelectNew_Click() Application.ScreenUpdating = False Unload Me Application.EnableEvents = True Application.Run ("MainHideAll") Windows("Main Menu").Visible = True ThisWorkbook.gMacro = True Application.ScreenUpdating = True Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" ThisWorkbook.Close savechanges:=True End Sub Any help would be appreciated! -- Thanks, Gerry O. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
I can't tell why the first form does not reappear, but
Application.Run ("HideAll") Application.Run ("MainHideAll") Just use: HideAll MainHideAll Routines in the same workbook as the caller can be called directly. -- Jim "Gerry O" wrote in message ... |I have two files. First file runs through a userid/password validation then | gives user a list of files to open on userform. After selection, userform is | hidden (me.hide), second file opens. User makes changes, etc. Command | button gives user option on second file to close & save changes and reshow | the userform on first file to make another selection. After saving changes | and closing on second file, userform on first file should be re-shown. My | current code does close and save the file, but when focus returns to first | file, userform is not visible. | | Here is code to close second file and return to first file: | | Private Sub Show_Cost_Center() | | Application.Run ("HideAll") | Return_Cost_Center.Show vbModeless | | End Sub | | Here is code on first file to re-show the userform: | | Private Sub cmbSelectNew_Click() | | Application.ScreenUpdating = False | Unload Me | Application.EnableEvents = True | Application.Run ("MainHideAll") | Windows("Main Menu").Visible = True | ThisWorkbook.gMacro = True | Application.ScreenUpdating = True | Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" | ThisWorkbook.Close savechanges:=True | | End Sub | | Any help would be appreciated! | | -- | Thanks, | | Gerry O. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
Is that true for Private Subs too?
-- Thanks, Gerry O. "Jim Rech" wrote: I can't tell why the first form does not reappear, but Application.Run ("HideAll") Application.Run ("MainHideAll") Just use: HideAll MainHideAll Routines in the same workbook as the caller can be called directly. -- Jim "Gerry O" wrote in message ... |I have two files. First file runs through a userid/password validation then | gives user a list of files to open on userform. After selection, userform is | hidden (me.hide), second file opens. User makes changes, etc. Command | button gives user option on second file to close & save changes and reshow | the userform on first file to make another selection. After saving changes | and closing on second file, userform on first file should be re-shown. My | current code does close and save the file, but when focus returns to first | file, userform is not visible. | | Here is code to close second file and return to first file: | | Private Sub Show_Cost_Center() | | Application.Run ("HideAll") | Return_Cost_Center.Show vbModeless | | End Sub | | Here is code on first file to re-show the userform: | | Private Sub cmbSelectNew_Click() | | Application.ScreenUpdating = False | Unload Me | Application.EnableEvents = True | Application.Run ("MainHideAll") | Windows("Main Menu").Visible = True | ThisWorkbook.gMacro = True | Application.ScreenUpdating = True | Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" | ThisWorkbook.Close savechanges:=True | | End Sub | | Any help would be appreciated! | | -- | Thanks, | | Gerry O. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
Is that true for Private Subs too?
Yup. -- Jim "Gerry O" wrote in message ... | Is that true for Private Subs too? | -- | Thanks, | | Gerry O. | | | "Jim Rech" wrote: | | I can't tell why the first form does not reappear, but | | Application.Run ("HideAll") | Application.Run ("MainHideAll") | | Just use: | | HideAll | MainHideAll | | Routines in the same workbook as the caller can be called directly. | | -- | Jim | "Gerry O" wrote in message | ... | |I have two files. First file runs through a userid/password validation | then | | gives user a list of files to open on userform. After selection, userform | is | | hidden (me.hide), second file opens. User makes changes, etc. Command | | button gives user option on second file to close & save changes and reshow | | the userform on first file to make another selection. After saving | changes | | and closing on second file, userform on first file should be re-shown. My | | current code does close and save the file, but when focus returns to first | | file, userform is not visible. | | | | Here is code to close second file and return to first file: | | | | Private Sub Show_Cost_Center() | | | | Application.Run ("HideAll") | | Return_Cost_Center.Show vbModeless | | | | End Sub | | | | Here is code on first file to re-show the userform: | | | | Private Sub cmbSelectNew_Click() | | | | Application.ScreenUpdating = False | | Unload Me | | Application.EnableEvents = True | | Application.Run ("MainHideAll") | | Windows("Main Menu").Visible = True | | ThisWorkbook.gMacro = True | | Application.ScreenUpdating = True | | Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" | | ThisWorkbook.Close savechanges:=True | | | | End Sub | | | | Any help would be appreciated! | | | | -- | | Thanks, | | | | Gerry O. | | | |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
But only if the calling sub and called sub are in the same module, right?
Jim Rech wrote: Is that true for Private Subs too? Yup. -- Jim "Gerry O" wrote in message ... | Is that true for Private Subs too? | -- | Thanks, | | Gerry O. | | | "Jim Rech" wrote: | | I can't tell why the first form does not reappear, but | | Application.Run ("HideAll") | Application.Run ("MainHideAll") | | Just use: | | HideAll | MainHideAll | | Routines in the same workbook as the caller can be called directly. | | -- | Jim | "Gerry O" wrote in message | ... | |I have two files. First file runs through a userid/password validation | then | | gives user a list of files to open on userform. After selection, userform | is | | hidden (me.hide), second file opens. User makes changes, etc. Command | | button gives user option on second file to close & save changes and reshow | | the userform on first file to make another selection. After saving | changes | | and closing on second file, userform on first file should be re-shown. My | | current code does close and save the file, but when focus returns to first | | file, userform is not visible. | | | | Here is code to close second file and return to first file: | | | | Private Sub Show_Cost_Center() | | | | Application.Run ("HideAll") | | Return_Cost_Center.Show vbModeless | | | | End Sub | | | | Here is code on first file to re-show the userform: | | | | Private Sub cmbSelectNew_Click() | | | | Application.ScreenUpdating = False | | Unload Me | | Application.EnableEvents = True | | Application.Run ("MainHideAll") | | Windows("Main Menu").Visible = True | | ThisWorkbook.gMacro = True | | Application.ScreenUpdating = True | | Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" | | ThisWorkbook.Close savechanges:=True | | | | End Sub | | | | Any help would be appreciated! | | | | -- | | Thanks, | | | | Gerry O. | | | -- Dave Peterson |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
But only if the calling sub and called sub are in the same module, right?
Yeah, I thought he meant Option Private Module but it's pretty obvious he didn't. Thanks. -- Jim "Dave Peterson" wrote in message ... But only if the calling sub and called sub are in the same module, right? Jim Rech wrote: Is that true for Private Subs too? Yup. -- Jim "Gerry O" wrote in message ... | Is that true for Private Subs too? | -- | Thanks, | | Gerry O. | | | "Jim Rech" wrote: | | I can't tell why the first form does not reappear, but | | Application.Run ("HideAll") | Application.Run ("MainHideAll") | | Just use: | | HideAll | MainHideAll | | Routines in the same workbook as the caller can be called directly. | | -- | Jim | "Gerry O" wrote in message | ... | |I have two files. First file runs through a userid/password validation | then | | gives user a list of files to open on userform. After selection, userform | is | | hidden (me.hide), second file opens. User makes changes, etc. Command | | button gives user option on second file to close & save changes and reshow | | the userform on first file to make another selection. After saving | changes | | and closing on second file, userform on first file should be re-shown. My | | current code does close and save the file, but when focus returns to first | | file, userform is not visible. | | | | Here is code to close second file and return to first file: | | | | Private Sub Show_Cost_Center() | | | | Application.Run ("HideAll") | | Return_Cost_Center.Show vbModeless | | | | End Sub | | | | Here is code on first file to re-show the userform: | | | | Private Sub cmbSelectNew_Click() | | | | Application.ScreenUpdating = False | | Unload Me | | Application.EnableEvents = True | | Application.Run ("MainHideAll") | | Windows("Main Menu").Visible = True | | ThisWorkbook.gMacro = True | | Application.ScreenUpdating = True | | Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" | | ThisWorkbook.Close savechanges:=True | | | | End Sub | | | | Any help would be appreciated! | | | | -- | | Thanks, | | | | Gerry O. | | | -- Dave Peterson |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
Is that true for Private Subs too?
You declare a sub private so that it cannot be called from outside its module. If you decide you want to then removing the Private is another way to go. -- Jim "Gerry O" wrote in message ... Is that true for Private Subs too? -- Thanks, Gerry O. "Jim Rech" wrote: I can't tell why the first form does not reappear, but Application.Run ("HideAll") Application.Run ("MainHideAll") Just use: HideAll MainHideAll Routines in the same workbook as the caller can be called directly. -- Jim "Gerry O" wrote in message ... |I have two files. First file runs through a userid/password validation then | gives user a list of files to open on userform. After selection, userform is | hidden (me.hide), second file opens. User makes changes, etc. Command | button gives user option on second file to close & save changes and reshow | the userform on first file to make another selection. After saving changes | and closing on second file, userform on first file should be re-shown. My | current code does close and save the file, but when focus returns to first | file, userform is not visible. | | Here is code to close second file and return to first file: | | Private Sub Show_Cost_Center() | | Application.Run ("HideAll") | Return_Cost_Center.Show vbModeless | | End Sub | | Here is code on first file to re-show the userform: | | Private Sub cmbSelectNew_Click() | | Application.ScreenUpdating = False | Unload Me | Application.EnableEvents = True | Application.Run ("MainHideAll") | Windows("Main Menu").Visible = True | ThisWorkbook.gMacro = True | Application.ScreenUpdating = True | Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" | ThisWorkbook.Close savechanges:=True | | End Sub | | Any help would be appreciated! | | -- | Thanks, | | Gerry O. |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
Thanks, Jim. I definitely want to keep private as I don't want users to be
able to see macros if they select run macro from the tools menu. Thanks for the info, though. I learned something new! -- Thanks, Gerry O. "Jim Rech" wrote: Is that true for Private Subs too? You declare a sub private so that it cannot be called from outside its module. If you decide you want to then removing the Private is another way to go. -- Jim "Gerry O" wrote in message ... Is that true for Private Subs too? -- Thanks, Gerry O. "Jim Rech" wrote: I can't tell why the first form does not reappear, but Application.Run ("HideAll") Application.Run ("MainHideAll") Just use: HideAll MainHideAll Routines in the same workbook as the caller can be called directly. -- Jim "Gerry O" wrote in message ... |I have two files. First file runs through a userid/password validation then | gives user a list of files to open on userform. After selection, userform is | hidden (me.hide), second file opens. User makes changes, etc. Command | button gives user option on second file to close & save changes and reshow | the userform on first file to make another selection. After saving changes | and closing on second file, userform on first file should be re-shown. My | current code does close and save the file, but when focus returns to first | file, userform is not visible. | | Here is code to close second file and return to first file: | | Private Sub Show_Cost_Center() | | Application.Run ("HideAll") | Return_Cost_Center.Show vbModeless | | End Sub | | Here is code on first file to re-show the userform: | | Private Sub cmbSelectNew_Click() | | Application.ScreenUpdating = False | Unload Me | Application.EnableEvents = True | Application.Run ("MainHideAll") | Windows("Main Menu").Visible = True | ThisWorkbook.gMacro = True | Application.ScreenUpdating = True | Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" | ThisWorkbook.Close savechanges:=True | | End Sub | | Any help would be appreciated! | | -- | Thanks, | | Gerry O. |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Userform won't show after closing another file
I don't want users to be able to see macros if they select run macro from
the tools menu. If you put Option Private Module at the top of the module users will not be able to see the macros and you'll be able to call them directly. The best of both worlds!<g -- Jim "Gerry O" wrote in message ... | Thanks, Jim. I definitely want to keep private as I don't want users to be | able to see macros if they select run macro from the tools menu. Thanks for | the info, though. I learned something new! | -- | Thanks, | | Gerry O. | | | "Jim Rech" wrote: | | Is that true for Private Subs too? | | You declare a sub private so that it cannot be called from outside its | module. If you decide you want to then removing the Private is another way | to go. | | -- | Jim | "Gerry O" wrote in message | ... | Is that true for Private Subs too? | -- | Thanks, | | Gerry O. | | | "Jim Rech" wrote: | | I can't tell why the first form does not reappear, but | | Application.Run ("HideAll") | Application.Run ("MainHideAll") | | Just use: | | HideAll | MainHideAll | | Routines in the same workbook as the caller can be called directly. | | -- | Jim | "Gerry O" wrote in message | ... | |I have two files. First file runs through a userid/password validation | then | | gives user a list of files to open on userform. After selection, | userform | is | | hidden (me.hide), second file opens. User makes changes, etc. Command | | button gives user option on second file to close & save changes and | reshow | | the userform on first file to make another selection. After saving | changes | | and closing on second file, userform on first file should be re-shown. | My | | current code does close and save the file, but when focus returns to | first | | file, userform is not visible. | | | | Here is code to close second file and return to first file: | | | | Private Sub Show_Cost_Center() | | | | Application.Run ("HideAll") | | Return_Cost_Center.Show vbModeless | | | | End Sub | | | | Here is code on first file to re-show the userform: | | | | Private Sub cmbSelectNew_Click() | | | | Application.ScreenUpdating = False | | Unload Me | | Application.EnableEvents = True | | Application.Run ("MainHideAll") | | Windows("Main Menu").Visible = True | | ThisWorkbook.gMacro = True | | Application.ScreenUpdating = True | | Application.Run "'ABS Open v2.0.xls'!Show_Cost_Center" | | ThisWorkbook.Close savechanges:=True | | | | End Sub | | | | Any help would be appreciated! | | | | -- | | Thanks, | | | | Gerry O. | | | | | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Re-show userform after closing file - code help | Excel Discussion (Misc queries) | |||
Userform won't show when file re-opened | Excel Discussion (Misc queries) | |||
How to skip the save file notoification on file closing? | Excel Worksheet Functions | |||
File Says Read Only Even After Closing It | Excel Discussion (Misc queries) | |||
Properties window show nothing for a userform | Excel Discussion (Misc queries) |