UserForm Hangs

S

Stratuser

I have recently converted from Excel 2003 to Excel 2007. Two old programs
have macros that start automatically with Auto-Open, and both have the same
problem in Excel 2007, which never happened in Excel 2003: the userform
called up by the Auto_Open subroutine hangs. Then the Cancel button on the
userform won't do anything, and I have to delete the form with the form's
delete button. However, this does not happen when I restart the macro with a
control that is on the worksheet. It has something to do with Auto_Open.
Any ideas?
 
S

Stratuser

Here it is. The problem is at the end of the subroutine.

Sub Auto_Open()
Dim wkbk As Workbook

FixStuff
BuildingTable = False
HoldingFileOpen = False
Sheets("CoverPage").Activate
Application.DisplayStatusBar = True

'Get paths to subdirectories
GetSubdirectories

'Set default subdirectory to InputSubdirectory variable
ChDir InputSubdirectory

'if an eVestment holdings list is already open, then import its data
HoldingFileTest
If HoldingFileOpen = True Then
ImportEvestment

Else:
'Show main menu form as usual
MainMenuForm.Show
End If

End Sub
 

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

Top