Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Disable Addin Menu when file not open

I have an addin for Excel. I want to be able to grey out
(enable off) the menu items of the add-in when there is
not excel files open. Currently this is not so and if
the user clicks onto the menu items when a file is not
open, the routine generates an error. How do I grey
these out?

THanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Disable Addin Menu when file not open

Hi ExcelMonkey

You can use this to avoid the error

Sub test()
On Error GoTo QuitOpen
ActiveWorkbook.Activate
Userform.Show
Exit Sub
QuitOpen:
MsgBox "There is no file open", , "youradd-in name"
Exit Sub
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"ExcelMonkey" wrote in message ...
I have an addin for Excel. I want to be able to grey out
(enable off) the menu items of the add-in when there is
not excel files open. Currently this is not so and if
the user clicks onto the menu items when a file is not
open, the routine generates an error. How do I grey
these out?

THanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable System Alerts on File Open PeterM Excel Discussion (Misc queries) 1 June 25th 08 08:02 AM
File Not Found menu pops up after I open a file Harveytunes Excel Discussion (Misc queries) 3 January 27th 06 07:23 PM
Desktop shortcut to a named Excel file - every time I open it adds a "1" to the file name - how to disable? [email protected] Setting up and Configuration of Excel 2 November 27th 04 09:02 PM
Disable File-Save menu item in macro? BrianG[_4_] Excel Programming 1 February 25th 04 06:48 PM


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"