Excel file will not mouse-scroll upon opening

86ms3

New Member
Joined
Nov 16, 2017
Messages
14
I can manually scroll using the scroll bar. If click out of excel and back into it, then mouse scroll will work. If I open up a userform and close it down, the mouse will then scroll. Upon opening/activating there is no code being executed. No forms are open when opening the document. All forms are unloaded upon user canceling or 'X'ing out of the form. I don't have any code that hides the forms.

So I'm a little at a loss of why this is occurring, or if there is a fix. I tried setting scroll area upon opening workbook by google'ing potential fixes. I also tried Unload Me at workbook opening, but that gives an error as there is no userform open upon opening.

Any help is appreciated.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Bump, anybody have any clue? This would be super helpful if I could get this issue fixed. Or is there any code I can put in upon opening workbook that will help my issue?
 
Upvote 0
You said:
1. I can manually scroll using the scroll bar.
2. If click out of excel and back into it, then mouse scroll will work.
3. If I open up a userform and close it down, the mouse will then scroll.\

I do not understand when the scroll will not work.

If you open the UserForm Like this:
UserForm1.show the sheet scroll bars never works.

If you open the Userform like this the scroll bar will work:
UserForm1.Show Modeless

If you click on a cell in the sheet
 
Last edited:
Upvote 0
Thanks, I know this is confusing. When I say manually scroll, using the cursor and scrolling on the scroll bar on screen.

The only time the mouse scroll will not work is initially when the workbook is opened. Even if I switch tabs or other cells. Mouse scroll functionality will resume if I do a few things:
1. If I change windows and come back
2. If I initiate a userform and close out of it
3. If I enter in a value into a cell

There is some code that is performed as the workbook has been closed


Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)Workbook_Name
'Sheets("Whey").Protect ("cheese")
'Sheets("Skim").Protect ("cheese")
'Sheets("Milk").Protect ("cheese")
'Sheets("Cream").Protect ("cheese")


With Application
        .EnableEvents = False
        .DisplayAlerts = False
        ThisWorkbook.SaveAs (fname & WorkbookName)
        .EnableEvents = True
End With




End Sub
 
Last edited:
Upvote 0
I never use protected sheets. I would suggest turning off protection and see if that fixes problem.
If not remove all that on close code and see if that fixes the problem

Then you will know if either of these are causing the problem.
And then try narrowing it down.

And I do not see why your turning on and off display alerts and enable events

Turning off display alerts is like telling your smoke alarm in your house to not go off if there is a fire.
 
Last edited:
Upvote 0
I turned them off because the file will be overwriting (saveas) the old file open upon closing. I don't want the user to have the option to not save as, so I turn off alerts. Sheet protections are currently off as well, that code is quoted out.

I did delete the all the code, still no luck.
 
Upvote 0
I also put some vba code to scroll down 25 when opening, that works, but once again mousescroll will not work until some function has been performed in the sheet. It's acting like the workbook isn't active when clearly it is. (I did also try activating the workbook/sheet when opening as well)
 
Upvote 0

Forum statistics

Threads
1,213,515
Messages
6,114,080
Members
448,548
Latest member
harryls

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