MrExcel Publishing
Your One Stop for Excel Tips & Solutions

System Tray

Posted by Matt on January 20, 2002 2:00 PM

I've been working on this for a while without any luck, so any help would be greatly appreciated.

All I want is a macro that can minimize excel to the system tray. I can use the ShowWindow API to make Excel disappear. I know I need to use the Shell_NotifyIcon API to put an icon in the system tray, but I'm not having any luck.

Thanks in advance for your help.

Posted by Trevor on January 20, 2002 3:09 PM

not sure if this is what u mean and I haven't tried it myself, but may be worth checking out


Posted by Joe Was on January 20, 2002 6:13 PM

This will not add Excel to the system tray, but it will put the Excel window on the TaskBar. JSW

'Put the window on the TaskBar.
Application.WindowState = xlMinimized

'Bring the window back from the TaskBar.
Application.WindowState = xlNormal

Posted by Joe Was on January 20, 2002 6:34 PM

To add windows to the System Tray you do not use a macro it is done in windows.

On the Windows Start menu, point to Settings, and then click Taskbar & Start Menu.
Do one of the following:
For Windows 2000 and Windows Me:

Click the Advanced tab.

For Windows 98:

Click the Start Menu Programs tab.

Click Add, and then click Browse.
Locate the program you want to automatically start, and then click it.
Click OK.
Click Next, and then locate and double-click the Startup folder.
Type the name that you want to see on the menu, and then click Finish.
Click OK in the Taskbar and Start Menu Properties dialog box.

A macro can be used to put Excel or a Workbook on the Task Bar but not the System Tray, directly. The Excel Shell command could be used to install to the System Tray, but I have not done so. You could also turn a WorkBook into an add-in and add that WorkBook to the ToolBar under the Excel Window command, this I have done. JSW