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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting up my excel program. Few Problems

Status
Not open for further replies.

Guvnor

Technical User
Mar 26, 2002
12
GB
hey i want my program in excel to do various things before the program starts up but for some reason it is not working . Can someone tell me what i need to to make this piece of coding work or why it doesnt work?

'Routine to start the application, set up screen defaults, set up
'custom menuus, and go to the page 1.
'Automatically called by application when loaded when X is removed from name.
'Make sure that the Row and Column headers are turned off om each sheet
'separately as you save them.

Sub Run_Auto()
Application.ScreenUpdating = False
'Set Application Name
Application.Caption = "Gallus Gaming"
'Switch of the default menu for page 1.
'DeleteStandardMenu
'Activate page 1 - the start up menu \ interface sheet.
ThisWorkbook.Sheets("Main Menu").Activate
'Move cell cursor to a sheet of the screen
Range("A1").Select
'Line below must come after activating Start screen.
Hide_bars
Application.ScreenUpdating = True
MsgBox ("Welcome to the Gallus Gaming Accounts System'")
Range("a100").Select



End Sub


Thx Guvnor
 
Try renaming your routine as follows:

Private Sub Workbook_Open()


:)
 
Either rename the macro to "Auto_Open" if the code is in a regular VB module (i.e., Module1).

Or you can put the code in the "ThisWorkbook" module and use the Workbook_Open Event as recommend by Loomah.
 
wicked that was really good help

Thanks:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top