Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically open with a form in Excel 1

Status
Not open for further replies.

melt333

Technical User
Sep 26, 2002
12
GB
Hi,

I am trying to create an excel workbook to automatically open with a form (without a worksheet behind it). At the moment I have a button on the worksheet which opens the form for me, but I am not happy with that. I've read about the workbookopen event, but where does the procedure go, and how do you code it to open the form. I have tried using the code:

Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
Load frmProcess (frmProcess being the name of the form?!?!)
frmProcess.Show
End Sub

in the 'ThisWorkbook' module, to no avail - nothing happens.

PLEASE HELP!!!

In advance, your help is much appreciated
 
To get to the workbook open event, go to the VB Editor and within your project, double click on "This Workbook"
Choose "Workbook" from the left side dropdown. It should then place a workbook open sub there by default (but with no code)

Within that sub, place the following:

application.visible = false
frmProcess.Show

so your entire sub would look like this:

Private Sub Workbook_Open()
application.visible = false
frmProcess.Show
End Sub

This will show the form with no worksheet (well no excel to tell the truth) but you have to be very careful and make sure that there is a button on the form that has application.visible = true otherwise there will be an excel program running invisibly

If you just want a blank view behind and don't want to hide excel, I would suggest that you just use a blank worksheet, colour it white and turn off gridlines

HTH Rgds
~Geoff~
 
Excellent! So easy, when you know how?!?!

Thank you very much,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top