-1

I have a UserForm named sira_main in the workbook sira.xlsm, but it does not open automatically when I open the workbook.

I tried putting this code into the General Declarations section of the main sheet, but it doesn’t work:

Call sira_main.Show

Here is an image of the VBA project window: enter image description here

How can I make the UserForm show automatically when the workbook opens?

2

1 Answer 1

2

Call it when workbook open event happens (in ThisWorkbook):

Private Sub Workbook_Open() Call sira_main.Show End Sub 
Sign up to request clarification or add additional context in comments.

5 Comments

Call statement is obsolete, a simple sira_main.Showis sufficent.
And good practice would be to create an instance of the form an show that
@ComputerVersteher Got it! I can't remember if I once knew that call is obsolete. I just code following what I learnt from the book (and there is call in the example code).
@chrisneilsen by far more important, but without a proper link, users won't know why not to use UserForm1.Show!
@chrisneilsen Since I've only created small VBA projects to help my own work, haven't code that carefully. And this is the first time I know new in VBA. I'll dig into that.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.