0 votes
in VBA by Beginner (8 points)


First of all thank you for the work you are providing to us all.

I am learning a lot of vba with your tips.


I am using your Splash Screen. And must say that it was working awesome.. for two days :)

Now I am trying to open and am having the following errors.

1. No excel open. I click to open the excel file and have the error Runtime error 91 - Object variable or With block variable not set.

This appears at "This workbook" - in line ActiveWindow.Visible = True

2. With one or two excel files already open. If I open the file with the Splash Screen it gives "compile error. Expected variable or procedure, not module"

This appears at user module named SpashUserForm in comand module

Sub UserForm_Initialize()
    HideTitleBar Me
End Sub

With both of the errors the file does not open, Only can see the VBA programmer mode

Could you help me in how to turn this around?

by Super Expert (3.2k points)
Can you paste the code and a screenshot of the error you're seeing?
by Beginner (8 points)

Hi, In attach the screenshot of both situations

No excel file open

Private Sub Workbook_Open()
    Application.ScreenUpdating = False
    ActiveWindow.Visible = True
    Windows(ThisWorkbook.Name).Visible = True
    Application.ScreenUpdating = True
End Sub

With other excel file open

About the code lines you are requesting they are direct copy past from this link

by Beginner (0 points)
I'm having the same issue, what was the solution please?

1 Answer

0 votes
by Super Expert (3.2k points)

The second error appears if you have a module named "HideTitleBar." I suspsect you put the HideTitleBar macro from the tutorial inside a module named HideTitleBar. If so, you can either change the name of the module, or change the UserForm_Initialize routine to this:

Private Sub UserForm_Initialize()
    HideTitleBar.HideTitleBar Me
End Sub

The first error is a bit more puzzling. You can try changing the line causing the error to:

Application.ActiveWindow.Visible = False

But I'm not 100% sure that will work. If that doesn't work, you can just delete the line or comment it out. It's not a necessary step - it's just included for optics. It tries to hide your workbook before you loading the splash screen so people don't see the contents before the splash screen is finished. Without that line of code, the splash screen will still appear. It will simply overlay your visible workbook content.

Welcome to wellsr Q&A
wellsr Q&A is the VBA and Python programming community that rewards you for learning how to code.

Getting Started
VBA Cheat Sheets (On Sale Now)

Earn free prizes for asking VBA and Python questions and for answering questions asked by others in our community.

Looking for something else? Hire our professional VBA Help, instead.

What makes us different?
Our points system rewards you with a chance for free gifts based on the quality of your questions and answers. All you have to do is post and you could get rewarded, like these members:

ParserMonster $25 Amazon Gift Card
Hightree $10 Amazon Gift Card
Thales1 $10 Amazon Gift Card
runfunke $10 Amazon Gift Card
coolag $10 Amazon Gift Card
Siew Hun $10 Amazon Gift Card

So, why don't you join us? It really is an encouraging way to motivate members in our VBA and Python community.


For more programming tips visit the VBA Tutorials Blog and the Python Tutorials Blog.