Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Disable Control in Tools Menu

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Disable Control in Tools Menu

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Disable Control in Tools Menu

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Disable Control in Tools Menu

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Disable Control in Tools Menu

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
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 macro selections under tools menu Jeremy Excel Discussion (Misc queries) 1 April 19th 10 08:40 PM
I CAN'T SEE TOOLS MENU IN THE RIBBON KV Rajan Excel Discussion (Misc queries) 1 November 7th 07 04:06 PM
menu tools options jim w Excel Discussion (Misc queries) 0 October 11th 07 04:51 PM
Disable Tools Protection Protect Sheet for all users but one Win XP Excel Discussion (Misc queries) 6 January 17th 06 10:46 PM
Use of Control Tools Kathy New Users to Excel 4 January 26th 05 06:59 PM


All times are GMT +1. The time now is 06:34 AM.

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"