run vba automatically

  • Thread starter Thread starter R.H.
  • Start date Start date
R

R.H.

I am new to vba programming with excel though I have used visual basic. I
was wondering, can I design a form based project and have it execute
automatically when the spread sheet is opened or do you always have to go to
tools->macros->visual basic editor and then press the run button on the tool
bar.

Roger
 
The Auto_Open fires when you start up

Sub Auto_Open()
FormName.show
End sub
 
Thanks, but I added the subroutine as you suggested, but it does not run
automatically when I open the excel workbook. I still have to go to
tools, then macros, then visual basic editor and press the run button.

Roger
 
This sub needs to be in the ThisWorkbook code page.

Private Sub Workbook_Open()
'Put code to execute when the workbook is opened, here.

End Sub

The user still needs to click on the "Enable Macros" button when they are
prompted during the file opening (provided they have low or medium security
setting).

Troy
 
I meant to say...

The user still needs to click on the "Enable Macros" button when they are
prompted during the file opening (provided they have medium security
setting).

Troy
 

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