Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
I hope someone can help me. I have an add-in that creates an item on the Tools menu which is asigned to a macro in the add-in. Just an extra tool. This is a workbook related tool and I've noticed that the tools menu disables some of the items inside it when XL is open but no workbook is open. i.e it disables "Options", "Share workbook" and so on. I would like my tool to be disable as well when no workbook is open since it creates an error if used when no workbook is open. Can someone help me with the coding for this, or direct me to an example? TIA Regards JS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Juan
One way Sub test() On Error GoTo QuitOpen ActiveWorkbook.Activate 'your code Exit Sub QuitOpen: On Error GoTo 0 MsgBox "There is no file open", , "Your tool name" End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Juan Sanchez" wrote in message ... Hi all I hope someone can help me. I have an add-in that creates an item on the Tools menu which is asigned to a macro in the add-in. Just an extra tool. This is a workbook related tool and I've noticed that the tools menu disables some of the items inside it when XL is open but no workbook is open. i.e it disables "Options", "Share workbook" and so on. I would like my tool to be disable as well when no workbook is open since it creates an error if used when no workbook is open. Can someone help me with the coding for this, or direct me to an example? TIA Regards JS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ron
Thanks, thas sort of how I have the error handling sort out. What I was wondering is if I can actually maje the item appear dull and actually disable from the tools menu so that it can't be clicked at. or selected... On another question, what is the property that tells me if a book has been saved for the fisrt time? Regards JS -----Original Message----- Hi Juan One way Sub test() On Error GoTo QuitOpen ActiveWorkbook.Activate 'your code Exit Sub QuitOpen: On Error GoTo 0 MsgBox "There is no file open", , "Your tool name" End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Juan Sanchez" wrote in message ... Hi all I hope someone can help me. I have an add-in that creates an item on the Tools menu which is asigned to a macro in the add-in. Just an extra tool. This is a workbook related tool and I've noticed that the tools menu disables some of the items inside it when XL is open but no workbook is open. i.e it disables "Options", "Share workbook" and so on. I would like my tool to be disable as well when no workbook is open since it creates an error if used when no workbook is open. Can someone help me with the coding for this, or direct me to an example? TIA Regards JS . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Juan
out. What I was wondering is if I can actually maje the item appear dull and actually disable from the tools menu so that it can't be clicked at. or selected... I don't know ? On another question, what is the property that tells me if a book has been saved for the fisrt time? A workbook that is not saved don't have a path Sub test() If Len(ActiveWorkbook.Path) = 0 Then MsgBox "Not saved" Else MsgBox ActiveWorkbook.Path End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Juan Sanchez" wrote in message ... Hi Ron Thanks, thas sort of how I have the error handling sort out. What I was wondering is if I can actually maje the item appear dull and actually disable from the tools menu so that it can't be clicked at. or selected... On another question, what is the property that tells me if a book has been saved for the fisrt time? Regards JS -----Original Message----- Hi Juan One way Sub test() On Error GoTo QuitOpen ActiveWorkbook.Activate 'your code Exit Sub QuitOpen: On Error GoTo 0 MsgBox "There is no file open", , "Your tool name" End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Juan Sanchez" wrote in message ... Hi all I hope someone can help me. I have an add-in that creates an item on the Tools menu which is asigned to a macro in the add-in. Just an extra tool. This is a workbook related tool and I've noticed that the tools menu disables some of the items inside it when XL is open but no workbook is open. i.e it disables "Options", "Share workbook" and so on. I would like my tool to be disable as well when no workbook is open since it creates an error if used when no workbook is open. Can someone help me with the coding for this, or direct me to an example? TIA Regards JS . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ron, thanks a lot, that worked out great...
My add-in was creating a corrupted file that made XL crash when run on an unsaved workbook... I used If len(activeworkbook.path)=0 then goto NoSaved NoSaved: Bla Bla Bla exit sub It solved the problem... I appreciate it... thanks again... I'll keep looking on the other subject to see if it can be done... Cheers Juan -----Original Message----- Hi Juan out. What I was wondering is if I can actually maje the item appear dull and actually disable from the tools menu so that it can't be clicked at. or selected... I don't know ? On another question, what is the property that tells me if a book has been saved for the fisrt time? A workbook that is not saved don't have a path Sub test() If Len(ActiveWorkbook.Path) = 0 Then MsgBox "Not saved" Else MsgBox ActiveWorkbook.Path End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Juan Sanchez" wrote in message ... Hi Ron Thanks, thas sort of how I have the error handling sort out. What I was wondering is if I can actually maje the item appear dull and actually disable from the tools menu so that it can't be clicked at. or selected... On another question, what is the property that tells me if a book has been saved for the fisrt time? Regards JS -----Original Message----- Hi Juan One way Sub test() On Error GoTo QuitOpen ActiveWorkbook.Activate 'your code Exit Sub QuitOpen: On Error GoTo 0 MsgBox "There is no file open", , "Your tool name" End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Juan Sanchez" wrote in message ... Hi all I hope someone can help me. I have an add-in that creates an item on the Tools menu which is asigned to a macro in the add-in. Just an extra tool. This is a workbook related tool and I've noticed that the tools menu disables some of the items inside it when XL is open but no workbook is open. i.e it disables "Options", "Share workbook" and so on. I would like my tool to be disable as well when no workbook is open since it creates an error if used when no workbook is open. Can someone help me with the coding for this, or direct me to an example? TIA Regards JS . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disable macro selections under tools menu | Excel Discussion (Misc queries) | |||
I CAN'T SEE TOOLS MENU IN THE RIBBON | Excel Discussion (Misc queries) | |||
menu tools options | Excel Discussion (Misc queries) | |||
Disable Tools Protection Protect Sheet for all users but one | Excel Discussion (Misc queries) | |||
Use of Control Tools | New Users to Excel |