Showing form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have workbook(FillOrders) with code that opens another file (Orders) and
fills various worksheets (in Orders) from several other files that are opened
and then closed. When 'FillOrders' has completed filling all the worksheets
in 'Orders' , the following code is executed:

Workbooks("Orders.xls").Worksheets("Headers").Activate
Workbooks("FillOrders.xls").Close

The code in 'Orders' for the worksheet 'Headers' activate event is
"frmMenu.Show".
After 'FillOrders' is closed (by code above) , the worksheet 'Headers' (in
'Orders') is displayed, but frmMenu is not being displayed. If I switch to
another sheet and back to 'Headers', the form is displayed as expected.

How can I get this form to show automatically after 'FillOrders' is closed?

TIA
 
You need some code that says when Headers sheet is activated then show the
form. Here is the code you will need to add in the worksheet object called
Sheet(??) (Hearders)

Private Sub Worksheet_Activate()
frmMenu.Show
End Sub

Notice that this might make the form show ANYtime the worksheet is
activated. Use state management to control the form.

Best of luck
 
Just got back to this thread and read your reply.
How is what you are suggesting different from what I am doing?
From original post: "> > The code in 'Orders' for the worksheet 'Headers'
activate event is
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top