PC Review


Reply
Thread Tools Rate Thread

Alternate to ActiveWorkbook.Close

 
 
Tony Bender
Guest
Posts: n/a
 
      1st Jun 2009
My application has two workbooks, one is a menu with a UserForm.
There are numerous controls in the UserForm where the user makes
selections. They click on a CommandButton which opens the second
workbook. Upon reviewing the information on the selected Worksheet
the user has an option of returning to the menu.

My problem occurs when the user goes back and forth between the menu
and the resulting report. The second workbook is large and takes alot
of time to open, and I think my problem is that when the user returns
to the menu it closes the second workbook, and thus requires it to be
re-opened after each time.

Is there some code I could use instead of ActiveWorkbook.Close to
'hide' the second workbook while the user returns to the menu to
change their selections?

Here is my code:

Sub ReOpenUF3()
Application.DisplayAlerts = False
ActiveWorkbook.Close

UF3.LB1.Visible = False
UF3.CB7.Visible = True
UF3.TB2.Visible = True
UF3.TB2.Value = Sheets("cover").Range("XOProd")
UF3.Show
End Sub

Thank you for any help
 
Reply With Quote
 
 
 
 
r
Guest
Posts: n/a
 
      1st Jun 2009
Sub Test()
Dim WB As Excel.Workbook
Set WB = ActiveWorkbook
Windows(WB.Name).Visible = False
'....
Windows(WB.Name).Visible = True
End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"Tony Bender" wrote:

> My application has two workbooks, one is a menu with a UserForm.
> There are numerous controls in the UserForm where the user makes
> selections. They click on a CommandButton which opens the second
> workbook. Upon reviewing the information on the selected Worksheet
> the user has an option of returning to the menu.
>
> My problem occurs when the user goes back and forth between the menu
> and the resulting report. The second workbook is large and takes alot
> of time to open, and I think my problem is that when the user returns
> to the menu it closes the second workbook, and thus requires it to be
> re-opened after each time.
>
> Is there some code I could use instead of ActiveWorkbook.Close to
> 'hide' the second workbook while the user returns to the menu to
> change their selections?
>
> Here is my code:
>
> Sub ReOpenUF3()
> Application.DisplayAlerts = False
> ActiveWorkbook.Close
>
> UF3.LB1.Visible = False
> UF3.CB7.Visible = True
> UF3.TB2.Visible = True
> UF3.TB2.Value = Sheets("cover").Range("XOProd")
> UF3.Show
> End Sub
>
> Thank you for any help
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: ActiveWorkbook.close problem Gary''s Student Microsoft Excel Programming 0 24th May 2009 01:00 PM
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure pat12@poczta.onet.pl Microsoft Excel Programming 5 26th Sep 2006 03:11 PM
ActiveWorkbook.Close dallas Microsoft Excel Programming 0 3rd Nov 2004 06:27 PM
ActiveWorkbook.Close dallas Microsoft Excel Programming 2 3rd Nov 2004 05:56 PM
ActiveWorkbook.Close Matthew Microsoft Excel Programming 4 13th Nov 2003 02:48 AM


Features
 

Advertising
 

Newsgroups
 


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