Object Variable or With block variable not set

Eric Carolus

Board Regular
Joined
Sep 17, 2012
Messages
128
Office Version
  1. 2016
Platform
  1. Windows
Hi folks
I used the following code in a project and every time it comes back with:
Run-time error 91
Object Variable or With block variable not set

VBA Code:
Private Sub Workbook_Open()

Application.ScreenUpdating = False

    ActiveWindow.Visible = False

    SplashUserForm.Show

    Windows(ThisWorkbook.Name).Visible = True



' WORKBOOK OPEN WITH/AT SHEET "Information"

    Sheets("School Information").Select

    Application.ScreenUpdating = True

End Sub
I have searched the forum and found numerous solutions,
but I still cannot nail it.

What am I doing wrong?
Please help.

Crow
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Which line is highlighted by the debugger? Do you have a userform called SplashUserform in that workbook?
 
Upvote 0
Hi RoryA

The highlighted line is:

Windows(ThisWorkbook.Name).Visible = True

And Yes I have a user form called SpalshUserform in the workbook.

Thanks in advance.

Crow
 
Upvote 0
So this is after you close the userform? Or are you showing the form modelessly?
 
Upvote 0
Hi RoryA

The form (Splash Screen) is on a timer and not even Excel
is shown until the Splash screen is unloaded.

I sometimes also get the message
Subscript out of range
Run-time error 9

Thanks in advance.

Crow
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,731
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top