If ChildRet 0 Then Debug.Print "Found Listbox's Handle" Private Const SB_HORZ = 0 ' 0 Then Debug.Print "Found Userform's handle"ĬhildRet = FindWindowEx(lngMyHandle, ByVal 0&, "F3 Server 516c0000", vbNullString) Private Declare Function ShowScrollBar Lib "user32" (ByVal hWnd As Long, _īyVal wBar As Long, ByVal bShow As Long) As Long (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _ Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long For example Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ The logic is to get the handle of the listbox and then hide the scrollbar. Usually the APIs work but in this case it is not working.
SCROLL BAR MISSING IN EXCEL 2003 CODE
The code goes in the Worksheet specific module.There is no inbuilt property that you can use to hide the scrollbars. CommandBars("Formatting").Visible = True. CommandBars("Worksheet Menu Bar").Enabled = True. DisplayStatusBar = False End WithEnd SubPrivate Sub Worksheet_Deactivate() With Application. CommandBars("Formatting").Visible = False. CommandBars("Worksheet Menu Bar").Enabled = False. Private Sub Worksheet_Activate() With Application. If the problem lies in adding additional line(s) of code to it including the issue of the correct sheet to place the code in, please, I'd appreciate your help.Īgain, thanks very much for your kindness. Please could you kindly direct me on how best to use it - where I should place it so that it will affect ONLY the Main Menu sheet and not the other sheets in the workbook - and most importantly so that it does not affect any other new Excel worksheets that I might wish to open and work on subsequently. A few minutes ago, I took the code out of 'ThisWorkbook' and attached it to the 'Main Menu' sheet, but it would not work. I don't know if the problem arises from me pasting it into 'ThisWorkbook'. BUT, unfortunately, it affects all other new Excel workbooks/worksheets that I open. for the other sheets in the workbook intact - just as I want it. for the Main Menu sheet, and leaves the menus, toolbars, scrollbars, etc. I copied the code, went to the vba editor, clicked on 'ThisWorkbook', view code, and pasted it there. The idea is to hide the menu, toolbars etc. DisplayVerticalScrollBar = TrueĪpplication.DisplayFormulaBar = TrueĪpplication.DisplayStatusBar = TrueĪpplication.DisplayAlerts = True DisplayVerticalScrollBar = FalseĪpplication.DisplayFormulaBar = FalseĪpplication.DisplayStatusBar = FalseĪpplication.CommandBars("Worksheet Menu Bar").Enabled = TrueĪpplication.CommandBars("Standard").Visible = TrueĪpplication.CommandBars("Formatting").Visible = True If ActiveSheet.Name = "MAIN MENU" ThenĪpplication.CommandBars("Worksheet Menu Bar").Enabled = FalseĪpplication.CommandBars("Standard").Visible = FalseĪpplication.CommandBars("Formatting").Visible = False Private Sub Workbook_SheetActivate(ByVal Sh As Object) Please can someone help me so that I'll be able to get the standard menus, toolbars, scroll bars, etc.
SCROLL BAR MISSING IN EXCEL 2003 HOW TO
I don't know what to do or how to proceed. I suppose it is part of the price I have to pay for seeking to try things out on my own as I learn.įor now, I'm stuck. I know that my lack of knowledge and inexperience with vba codes has led me to this seemingly-grave error. And when I tried many more new workbooks and got the same problem, I deleted my entire Office 2003 installation and re-installed Office 2003. I called up the file with the code, deleted all the codes attached to that file, and re-saved the file.
I closed the workbook and tried opening a new workbook. However, when I closed the workbook and tried to open a NEW workbook so that I could do some other work, I realised that the new workbook and its accompanying sheets had the menus, toolbars, scroll bars, etc.
The 'hiding' code was not meant to affect the other two sheets. on the 'Menu' sheet so that no user can alter that 'Menu' sheet. I wanted to hide the Excel menus, toolbars, scrollbars, etc. The first sheet is the 'Menu' sheet on which I placed buttons to take me to the other two sheets and back. I was working on an Excel 2003 workbook with 3 worksheets.
Please I need help with an error that I have made.