View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Call user form from ThisWorkbook; close file if form closed

Using Office 2003 and Windows XP;

1. Could someone please post an example of a command that could call a sub
in a user Form module from the ThisWorkBook module?

For example:

In THISWORKBOOK:

Private Sub Workbook_Open()
Call UserForm_Initialize
End Sub

In FORM MODULE:

Public Sub UserForm_Initialize()
<other code here
Me.Show
End Sub

2. Is it possible to code a workbook to close automatically if the user form
is closed? If so, how?

Many thanks for your assistance.