Multiple Apps

Remove the Ask A Question Dropdown

Ease of Use

Easy

Version tested with

2000, 2002 

Submitted by:

Justinlabenne

Description:

Hides / Disables the Ask A Question Dropdown that can be found on Excel 2002 (XP) and up. 

Discussion:

Excel 2002 introduced the "Ask A Question Dropdown" that can be found on the Worksheet menu bar in all Office XP applications. To customize your Excel application and prevent your user from using this option, this code will disable it / enable it. When it is disabled, it disappears entirely. The code checks to make sure it is version compatible as the "Ask a question" option is not available in versions prior to 2002. Nothing happens if you try to run it in a previous version. Although an example is not included, this works for Access also 

Code:

instructions for use

			

Option Explicit Sub StopAskingQuestions() ' Remove the "Ask a Question" dropdown from the ' worksheet menu bar in Excel versions 2002 and up Dim objCBarTemp As Object With Application If Val(.Version) >= 10 Then Set objCBarTemp = .CommandBars objCBarTemp.DisableAskAQuestionDropdown = True End If End With Set objCBarTemp = Nothing End Sub Sub AgainWithTheQuestions() ' Re-enable it Dim objCBarTemp As Object With Application If Val(.Version) >= 10 Then Set objCBarTemp = .CommandBars objCBarTemp.DisableAskAQuestionDropdown = False End If End With Set objCBarTemp = Nothing End Sub

How to use:

  1. Open an Excel Workbook
  2. Copy the code
  3. Press Alt + F11 to open the Visual Basic Editor (VBE)
  4. Select INSERT > MODULE from the menubar
  5. Paste code into the right pane
  6. Press Alt+Q to return to Excel
  7. Save workbook before any other changes
 

Test the code:

  1. Go to TOOLS > MACRO > MACROS
  2. When the dialog appears, select {StopAskingQuestions}
  3. Press Run
  4. To Re-enable it
  5. Go to TOOLS > MACRO > MACROS
  6. When the dialog appears, select {AgainWithTheQuestions}
  7. Press Run
 

Sample File:

Ask Questions.zip 21.97KB 

Approved by mdmackillop


This entry has been viewed 68 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express