Can I access the "Windows in Taskbar" checkbox within a macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I access the state of the "Windows in Taskbar" checkbox and set it with
VBA code? Something is overriding the setting whenever I start Excel. It
defaults to not showing all of the windows in my taskbar.
 
Norman,

This works great but it changes behavior for all instances of Excel (I
believe)

is there a way to modify this so it is ONLY for the current instance\session ?
 
Hi Rick,

Possibly use the Before_Close event of a
workbook that will always be open -
possibly your Personal macro workbook,
to restore the setting.

'===========>>
Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ShowWindowsInTaskbar = False
End Sub
'<<===========

This is workbook event code and should be
pasted into the workbook's ThisWorkbook
module *not* a standard module or a sheet
module:

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your
workbook is maximised)
Select 'View Code' from the menu and paste
the code.

Alt-F11 to return to Excel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top