Excel 2007: Disable Office Menu control on the fly

I'm looking for a way to disable Office Menu controls such as: New, Save, 
SaveAs, etc on the fly. Whenever user opens an excel workbook into my 
application, those controls under Office Menu are disable.
 In office 2003, I could do something like this when user opens their 
workbook in my application: 
With objExcel.CommandBars("Worksheet Menu Bar")
       .Controls("&File").Controls("&New...").Enabled = False
       .Controls("&File").Controls("&Open...").Enabled = False
       .Controls("&File").Controls("&Close").Enabled = False

Thanks
0
11/17/2008 10:08:10 PM
excel 39879 articles. 2 followers. Follow

9 Replies
776 Views

Similar Articles

[PageSpeed] 5

Hi Gary 

See this page
http://www.rondebruin.nl/ribbon.htm

Download the example workbooks (point 2)


-- 

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
> I'm looking for a way to disable Office Menu controls such as: New, Save, 
> SaveAs, etc on the fly. Whenever user opens an excel workbook into my 
> application, those controls under Office Menu are disable.
> In office 2003, I could do something like this when user opens their 
> workbook in my application: 
> With objExcel.CommandBars("Worksheet Menu Bar")
>       .Controls("&File").Controls("&New...").Enabled = False
>       .Controls("&File").Controls("&Open...").Enabled = False
>       .Controls("&File").Controls("&Close").Enabled = False
> 
> Thanks
0
rondebruin (3790)
11/17/2008 10:14:43 PM
Hi Ron, 
Thanks for your reply. As I read your website and previous threads within 
this forum, this is what I understand from your website:
- let say users have Workbook A
- Users have to use CustomUI to customize Ribbon manually through .xml file. 
And the changes to Ribbon are only effected for Workbook A.

Is there a way we can automate this?
And if user open up workbook A, B, C, etc. into my application, can I be 
able to disable some controls under Office Menu as I did before with Office 
2003?
I'd appreciate for your help.
Thanks

"Ron de Bruin" wrote:

> Hi Gary 
> 
> See this page
> http://www.rondebruin.nl/ribbon.htm
> 
> Download the example workbooks (point 2)
> 
> 
> -- 
> 
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
> 
> 
> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
> > I'm looking for a way to disable Office Menu controls such as: New, Save, 
> > SaveAs, etc on the fly. Whenever user opens an excel workbook into my 
> > application, those controls under Office Menu are disable.
> > In office 2003, I could do something like this when user opens their 
> > workbook in my application: 
> > With objExcel.CommandBars("Worksheet Menu Bar")
> >       .Controls("&File").Controls("&New...").Enabled = False
> >       .Controls("&File").Controls("&Open...").Enabled = False
> >       .Controls("&File").Controls("&Close").Enabled = False
> > 
> > Thanks
> 
0
11/17/2008 10:59:01 PM
Hi Gary

If you save your workbook with ribbonx changes as a add-in it
is not only for one workbook but for all workbooks.

-- 

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:AC060B0B-3B17-45DA-A997-1BD4000F217F@microsoft.com...
> Hi Ron, 
> Thanks for your reply. As I read your website and previous threads within 
> this forum, this is what I understand from your website:
> - let say users have Workbook A
> - Users have to use CustomUI to customize Ribbon manually through .xml file. 
> And the changes to Ribbon are only effected for Workbook A.
> 
> Is there a way we can automate this?
> And if user open up workbook A, B, C, etc. into my application, can I be 
> able to disable some controls under Office Menu as I did before with Office 
> 2003?
> I'd appreciate for your help.
> Thanks
> 
> "Ron de Bruin" wrote:
> 
>> Hi Gary 
>> 
>> See this page
>> http://www.rondebruin.nl/ribbon.htm
>> 
>> Download the example workbooks (point 2)
>> 
>> 
>> -- 
>> 
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>> 
>> 
>> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
>> > I'm looking for a way to disable Office Menu controls such as: New, Save, 
>> > SaveAs, etc on the fly. Whenever user opens an excel workbook into my 
>> > application, those controls under Office Menu are disable.
>> > In office 2003, I could do something like this when user opens their 
>> > workbook in my application: 
>> > With objExcel.CommandBars("Worksheet Menu Bar")
>> >       .Controls("&File").Controls("&New...").Enabled = False
>> >       .Controls("&File").Controls("&Open...").Enabled = False
>> >       .Controls("&File").Controls("&Close").Enabled = False
>> > 
>> > Thanks
>>
0
rondebruin (3790)
11/17/2008 11:04:33 PM
More info

You can let your workbook open the addin with code when it opens and close the add-in when you close the workbook.

Good night





-- 

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:OZtEnjQSJHA.3880@TK2MSFTNGP04.phx.gbl...
> Hi Gary
>
> If you save your workbook with ribbonx changes as a add-in it
> is not only for one workbook but for all workbooks.
>
> -- 
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:AC060B0B-3B17-45DA-A997-1BD4000F217F@microsoft.com...
>> Hi Ron, Thanks for your reply. As I read your website and previous threads within this forum, this is what I understand from your 
>> website:
>> - let say users have Workbook A
>> - Users have to use CustomUI to customize Ribbon manually through .xml file. And the changes to Ribbon are only effected for 
>> Workbook A.
>>
>> Is there a way we can automate this?
>> And if user open up workbook A, B, C, etc. into my application, can I be able to disable some controls under Office Menu as I did 
>> before with Office 2003?
>> I'd appreciate for your help.
>> Thanks
>>
>> "Ron de Bruin" wrote:
>>
>>> Hi Gary See this page
>>> http://www.rondebruin.nl/ribbon.htm
>>>
>>> Download the example workbooks (point 2)
>>>
>>>
>>> -- 
>>>
>>> Regards Ron de Bruin
>>> http://www.rondebruin.nl/tips.htm
>>>
>>>
>>> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
>>> > I'm looking for a way to disable Office Menu controls such as: New, Save, SaveAs, etc on the fly. Whenever user opens an excel 
>>> > workbook into my application, those controls under Office Menu are disable.
>>> > In office 2003, I could do something like this when user opens their workbook in my application: With 
>>> > objExcel.CommandBars("Worksheet Menu Bar")
>>> >       .Controls("&File").Controls("&New...").Enabled = False
>>> >       .Controls("&File").Controls("&Open...").Enabled = False
>>> >       .Controls("&File").Controls("&Close").Enabled = False
>>> >
>>> > Thanks
>>> 

0
rondebruin (3790)
11/17/2008 11:17:40 PM
Ron, thanks very much for your reply.
I'm new to Office Development as well. I'm fixing a bug in our application 
that can adapt with Office 2007. Can you please point me further instructions 
where I can integrate this workbook into Excel as Addin?
By the way, I hope this method should work for Word and PowerPoint as well.
I'd appreciate your help.
Thanks

"Ron de Bruin" wrote:

> More info
> 
> You can let your workbook open the addin with code when it opens and close the add-in when you close the workbook.
> 
> Good night
> 
> 
> 
> 
> 
> -- 
> 
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
> 
> 
> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:OZtEnjQSJHA.3880@TK2MSFTNGP04.phx.gbl...
> > Hi Gary
> >
> > If you save your workbook with ribbonx changes as a add-in it
> > is not only for one workbook but for all workbooks.
> >
> > -- 
> >
> > Regards Ron de Bruin
> > http://www.rondebruin.nl/tips.htm
> >
> >
> > "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:AC060B0B-3B17-45DA-A997-1BD4000F217F@microsoft.com...
> >> Hi Ron, Thanks for your reply. As I read your website and previous threads within this forum, this is what I understand from your 
> >> website:
> >> - let say users have Workbook A
> >> - Users have to use CustomUI to customize Ribbon manually through .xml file. And the changes to Ribbon are only effected for 
> >> Workbook A.
> >>
> >> Is there a way we can automate this?
> >> And if user open up workbook A, B, C, etc. into my application, can I be able to disable some controls under Office Menu as I did 
> >> before with Office 2003?
> >> I'd appreciate for your help.
> >> Thanks
> >>
> >> "Ron de Bruin" wrote:
> >>
> >>> Hi Gary See this page
> >>> http://www.rondebruin.nl/ribbon.htm
> >>>
> >>> Download the example workbooks (point 2)
> >>>
> >>>
> >>> -- 
> >>>
> >>> Regards Ron de Bruin
> >>> http://www.rondebruin.nl/tips.htm
> >>>
> >>>
> >>> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
> >>> > I'm looking for a way to disable Office Menu controls such as: New, Save, SaveAs, etc on the fly. Whenever user opens an excel 
> >>> > workbook into my application, those controls under Office Menu are disable.
> >>> > In office 2003, I could do something like this when user opens their workbook in my application: With 
> >>> > objExcel.CommandBars("Worksheet Menu Bar")
> >>> >       .Controls("&File").Controls("&New...").Enabled = False
> >>> >       .Controls("&File").Controls("&Open...").Enabled = False
> >>> >       .Controls("&File").Controls("&Close").Enabled = False
> >>> >
> >>> > Thanks
> >>> 
> 
> 
0
11/18/2008 7:14:12 PM
Hi Gary

There are dictator workbook examples on this page that you can save as a add-in
http://www.rondebruin.nl/ribbon.htm

See point 2


-- 

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:4696AC93-929F-411B-91E3-8647824A1934@microsoft.com...
> Ron, thanks very much for your reply.
> I'm new to Office Development as well. I'm fixing a bug in our application
> that can adapt with Office 2007. Can you please point me further instructions
> where I can integrate this workbook into Excel as Addin?
> By the way, I hope this method should work for Word and PowerPoint as well.
> I'd appreciate your help.
> Thanks
>
> "Ron de Bruin" wrote:
>
>> More info
>>
>> You can let your workbook open the addin with code when it opens and close the add-in when you close the workbook.
>>
>> Good night
>>
>>
>>
>>
>>
>> -- 
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:OZtEnjQSJHA.3880@TK2MSFTNGP04.phx.gbl...
>> > Hi Gary
>> >
>> > If you save your workbook with ribbonx changes as a add-in it
>> > is not only for one workbook but for all workbooks.
>> >
>> > -- 
>> >
>> > Regards Ron de Bruin
>> > http://www.rondebruin.nl/tips.htm
>> >
>> >
>> > "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message 
>> > news:AC060B0B-3B17-45DA-A997-1BD4000F217F@microsoft.com...
>> >> Hi Ron, Thanks for your reply. As I read your website and previous threads within this forum, this is what I understand from 
>> >> your
>> >> website:
>> >> - let say users have Workbook A
>> >> - Users have to use CustomUI to customize Ribbon manually through .xml file. And the changes to Ribbon are only effected for
>> >> Workbook A.
>> >>
>> >> Is there a way we can automate this?
>> >> And if user open up workbook A, B, C, etc. into my application, can I be able to disable some controls under Office Menu as I 
>> >> did
>> >> before with Office 2003?
>> >> I'd appreciate for your help.
>> >> Thanks
>> >>
>> >> "Ron de Bruin" wrote:
>> >>
>> >>> Hi Gary See this page
>> >>> http://www.rondebruin.nl/ribbon.htm
>> >>>
>> >>> Download the example workbooks (point 2)
>> >>>
>> >>>
>> >>> -- 
>> >>>
>> >>> Regards Ron de Bruin
>> >>> http://www.rondebruin.nl/tips.htm
>> >>>
>> >>>
>> >>> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message 
>> >>> news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
>> >>> > I'm looking for a way to disable Office Menu controls such as: New, Save, SaveAs, etc on the fly. Whenever user opens an 
>> >>> > excel
>> >>> > workbook into my application, those controls under Office Menu are disable.
>> >>> > In office 2003, I could do something like this when user opens their workbook in my application: With
>> >>> > objExcel.CommandBars("Worksheet Menu Bar")
>> >>> >       .Controls("&File").Controls("&New...").Enabled = False
>> >>> >       .Controls("&File").Controls("&Open...").Enabled = False
>> >>> >       .Controls("&File").Controls("&Close").Enabled = False
>> >>> >
>> >>> > Thanks
>> >>>
>>
>> 

0
rondebruin (3790)
11/19/2008 9:08:59 PM
Ron,
Thanks for your reply. I already had an add-in. I'm now looking for code 
that can hook up this add-in into excel so every time user open/close a 
workbook in my application, my code will attach/detach this add-in.
Thanks,
Chau

"Ron de Bruin" wrote:

> Hi Gary
> 
> There are dictator workbook examples on this page that you can save as a add-in
> http://www.rondebruin.nl/ribbon.htm
> 
> See point 2
> 
> 
> -- 
> 
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
> 
> 
> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:4696AC93-929F-411B-91E3-8647824A1934@microsoft.com...
> > Ron, thanks very much for your reply.
> > I'm new to Office Development as well. I'm fixing a bug in our application
> > that can adapt with Office 2007. Can you please point me further instructions
> > where I can integrate this workbook into Excel as Addin?
> > By the way, I hope this method should work for Word and PowerPoint as well.
> > I'd appreciate your help.
> > Thanks
> >
> > "Ron de Bruin" wrote:
> >
> >> More info
> >>
> >> You can let your workbook open the addin with code when it opens and close the add-in when you close the workbook.
> >>
> >> Good night
> >>
> >>
> >>
> >>
> >>
> >> -- 
> >>
> >> Regards Ron de Bruin
> >> http://www.rondebruin.nl/tips.htm
> >>
> >>
> >> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:OZtEnjQSJHA.3880@TK2MSFTNGP04.phx.gbl...
> >> > Hi Gary
> >> >
> >> > If you save your workbook with ribbonx changes as a add-in it
> >> > is not only for one workbook but for all workbooks.
> >> >
> >> > -- 
> >> >
> >> > Regards Ron de Bruin
> >> > http://www.rondebruin.nl/tips.htm
> >> >
> >> >
> >> > "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message 
> >> > news:AC060B0B-3B17-45DA-A997-1BD4000F217F@microsoft.com...
> >> >> Hi Ron, Thanks for your reply. As I read your website and previous threads within this forum, this is what I understand from 
> >> >> your
> >> >> website:
> >> >> - let say users have Workbook A
> >> >> - Users have to use CustomUI to customize Ribbon manually through .xml file. And the changes to Ribbon are only effected for
> >> >> Workbook A.
> >> >>
> >> >> Is there a way we can automate this?
> >> >> And if user open up workbook A, B, C, etc. into my application, can I be able to disable some controls under Office Menu as I 
> >> >> did
> >> >> before with Office 2003?
> >> >> I'd appreciate for your help.
> >> >> Thanks
> >> >>
> >> >> "Ron de Bruin" wrote:
> >> >>
> >> >>> Hi Gary See this page
> >> >>> http://www.rondebruin.nl/ribbon.htm
> >> >>>
> >> >>> Download the example workbooks (point 2)
> >> >>>
> >> >>>
> >> >>> -- 
> >> >>>
> >> >>> Regards Ron de Bruin
> >> >>> http://www.rondebruin.nl/tips.htm
> >> >>>
> >> >>>
> >> >>> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message 
> >> >>> news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
> >> >>> > I'm looking for a way to disable Office Menu controls such as: New, Save, SaveAs, etc on the fly. Whenever user opens an 
> >> >>> > excel
> >> >>> > workbook into my application, those controls under Office Menu are disable.
> >> >>> > In office 2003, I could do something like this when user opens their workbook in my application: With
> >> >>> > objExcel.CommandBars("Worksheet Menu Bar")
> >> >>> >       .Controls("&File").Controls("&New...").Enabled = False
> >> >>> >       .Controls("&File").Controls("&Open...").Enabled = False
> >> >>> >       .Controls("&File").Controls("&Close").Enabled = False
> >> >>> >
> >> >>> > Thanks
> >> >>>
> >>
> >> 
> 
> 
0
11/19/2008 9:19:01 PM
Hi Gary

Basic code in the Thisworkbook module looks like this of the add-in is in the same folder
as the workbooks (if not change the path)

Private Sub Workbook_Activate()
    If bIsBookOpen_RB("MenuAddin.xlam") = False Then
        Workbooks.Open (ThisWorkbook.Path & "\MenuAddin.xlam")
    End If
End Sub

Private Sub Workbook_Deactivate()
    If bIsBookOpen_RB("MenuAddin.xlam") = True Then
        Workbooks("MenuAddin.xlam").Close False
    End If
End Sub

Function bIsBookOpen_RB(ByRef szBookName As String) As Boolean
' Rob Bovey
    On Error Resume Next
    bIsBookOpen_RB = Not (Application.Workbooks(szBookName) Is Nothing)
End Function


-- 

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:2C8FE1D7-14F9-4359-8479-8CB90F8A8C11@microsoft.com...
> Ron,
> Thanks for your reply. I already had an add-in. I'm now looking for code
> that can hook up this add-in into excel so every time user open/close a
> workbook in my application, my code will attach/detach this add-in.
> Thanks,
> Chau
>
> "Ron de Bruin" wrote:
>
>> Hi Gary
>>
>> There are dictator workbook examples on this page that you can save as a add-in
>> http://www.rondebruin.nl/ribbon.htm
>>
>> See point 2
>>
>>
>> -- 
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:4696AC93-929F-411B-91E3-8647824A1934@microsoft.com...
>> > Ron, thanks very much for your reply.
>> > I'm new to Office Development as well. I'm fixing a bug in our application
>> > that can adapt with Office 2007. Can you please point me further instructions
>> > where I can integrate this workbook into Excel as Addin?
>> > By the way, I hope this method should work for Word and PowerPoint as well.
>> > I'd appreciate your help.
>> > Thanks
>> >
>> > "Ron de Bruin" wrote:
>> >
>> >> More info
>> >>
>> >> You can let your workbook open the addin with code when it opens and close the add-in when you close the workbook.
>> >>
>> >> Good night
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> -- 
>> >>
>> >> Regards Ron de Bruin
>> >> http://www.rondebruin.nl/tips.htm
>> >>
>> >>
>> >> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:OZtEnjQSJHA.3880@TK2MSFTNGP04.phx.gbl...
>> >> > Hi Gary
>> >> >
>> >> > If you save your workbook with ribbonx changes as a add-in it
>> >> > is not only for one workbook but for all workbooks.
>> >> >
>> >> > -- 
>> >> >
>> >> > Regards Ron de Bruin
>> >> > http://www.rondebruin.nl/tips.htm
>> >> >
>> >> >
>> >> > "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message
>> >> > news:AC060B0B-3B17-45DA-A997-1BD4000F217F@microsoft.com...
>> >> >> Hi Ron, Thanks for your reply. As I read your website and previous threads within this forum, this is what I understand 
>> >> >> from
>> >> >> your
>> >> >> website:
>> >> >> - let say users have Workbook A
>> >> >> - Users have to use CustomUI to customize Ribbon manually through .xml file. And the changes to Ribbon are only effected 
>> >> >> for
>> >> >> Workbook A.
>> >> >>
>> >> >> Is there a way we can automate this?
>> >> >> And if user open up workbook A, B, C, etc. into my application, can I be able to disable some controls under Office Menu as 
>> >> >> I
>> >> >> did
>> >> >> before with Office 2003?
>> >> >> I'd appreciate for your help.
>> >> >> Thanks
>> >> >>
>> >> >> "Ron de Bruin" wrote:
>> >> >>
>> >> >>> Hi Gary See this page
>> >> >>> http://www.rondebruin.nl/ribbon.htm
>> >> >>>
>> >> >>> Download the example workbooks (point 2)
>> >> >>>
>> >> >>>
>> >> >>> -- 
>> >> >>>
>> >> >>> Regards Ron de Bruin
>> >> >>> http://www.rondebruin.nl/tips.htm
>> >> >>>
>> >> >>>
>> >> >>> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message
>> >> >>> news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
>> >> >>> > I'm looking for a way to disable Office Menu controls such as: New, Save, SaveAs, etc on the fly. Whenever user opens an
>> >> >>> > excel
>> >> >>> > workbook into my application, those controls under Office Menu are disable.
>> >> >>> > In office 2003, I could do something like this when user opens their workbook in my application: With
>> >> >>> > objExcel.CommandBars("Worksheet Menu Bar")
>> >> >>> >       .Controls("&File").Controls("&New...").Enabled = False
>> >> >>> >       .Controls("&File").Controls("&Open...").Enabled = False
>> >> >>> >       .Controls("&File").Controls("&Close").Enabled = False
>> >> >>> >
>> >> >>> > Thanks
>> >> >>>
>> >>
>> >>
>>
>> 

0
rondebruin (3790)
11/19/2008 9:35:03 PM
Wow, it works. With this code, you actually attach/detach the template 
whenever user open/close a workbook.
Dump me while I'm looking for a way to "add-in" this template into workbook.
Anyway, thanks alot for your help.
I'll grade this message. 

"Ron de Bruin" wrote:

> Hi Gary
> 
> Basic code in the Thisworkbook module looks like this of the add-in is in the same folder
> as the workbooks (if not change the path)
> 
> Private Sub Workbook_Activate()
>     If bIsBookOpen_RB("MenuAddin.xlam") = False Then
>         Workbooks.Open (ThisWorkbook.Path & "\MenuAddin.xlam")
>     End If
> End Sub
> 
> Private Sub Workbook_Deactivate()
>     If bIsBookOpen_RB("MenuAddin.xlam") = True Then
>         Workbooks("MenuAddin.xlam").Close False
>     End If
> End Sub
> 
> Function bIsBookOpen_RB(ByRef szBookName As String) As Boolean
> ' Rob Bovey
>     On Error Resume Next
>     bIsBookOpen_RB = Not (Application.Workbooks(szBookName) Is Nothing)
> End Function
> 
> 
> -- 
> 
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
> 
> 
> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:2C8FE1D7-14F9-4359-8479-8CB90F8A8C11@microsoft.com...
> > Ron,
> > Thanks for your reply. I already had an add-in. I'm now looking for code
> > that can hook up this add-in into excel so every time user open/close a
> > workbook in my application, my code will attach/detach this add-in.
> > Thanks,
> > Chau
> >
> > "Ron de Bruin" wrote:
> >
> >> Hi Gary
> >>
> >> There are dictator workbook examples on this page that you can save as a add-in
> >> http://www.rondebruin.nl/ribbon.htm
> >>
> >> See point 2
> >>
> >>
> >> -- 
> >>
> >> Regards Ron de Bruin
> >> http://www.rondebruin.nl/tips.htm
> >>
> >>
> >> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message news:4696AC93-929F-411B-91E3-8647824A1934@microsoft.com...
> >> > Ron, thanks very much for your reply.
> >> > I'm new to Office Development as well. I'm fixing a bug in our application
> >> > that can adapt with Office 2007. Can you please point me further instructions
> >> > where I can integrate this workbook into Excel as Addin?
> >> > By the way, I hope this method should work for Word and PowerPoint as well.
> >> > I'd appreciate your help.
> >> > Thanks
> >> >
> >> > "Ron de Bruin" wrote:
> >> >
> >> >> More info
> >> >>
> >> >> You can let your workbook open the addin with code when it opens and close the add-in when you close the workbook.
> >> >>
> >> >> Good night
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> -- 
> >> >>
> >> >> Regards Ron de Bruin
> >> >> http://www.rondebruin.nl/tips.htm
> >> >>
> >> >>
> >> >> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:OZtEnjQSJHA.3880@TK2MSFTNGP04.phx.gbl...
> >> >> > Hi Gary
> >> >> >
> >> >> > If you save your workbook with ribbonx changes as a add-in it
> >> >> > is not only for one workbook but for all workbooks.
> >> >> >
> >> >> > -- 
> >> >> >
> >> >> > Regards Ron de Bruin
> >> >> > http://www.rondebruin.nl/tips.htm
> >> >> >
> >> >> >
> >> >> > "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message
> >> >> > news:AC060B0B-3B17-45DA-A997-1BD4000F217F@microsoft.com...
> >> >> >> Hi Ron, Thanks for your reply. As I read your website and previous threads within this forum, this is what I understand 
> >> >> >> from
> >> >> >> your
> >> >> >> website:
> >> >> >> - let say users have Workbook A
> >> >> >> - Users have to use CustomUI to customize Ribbon manually through .xml file. And the changes to Ribbon are only effected 
> >> >> >> for
> >> >> >> Workbook A.
> >> >> >>
> >> >> >> Is there a way we can automate this?
> >> >> >> And if user open up workbook A, B, C, etc. into my application, can I be able to disable some controls under Office Menu as 
> >> >> >> I
> >> >> >> did
> >> >> >> before with Office 2003?
> >> >> >> I'd appreciate for your help.
> >> >> >> Thanks
> >> >> >>
> >> >> >> "Ron de Bruin" wrote:
> >> >> >>
> >> >> >>> Hi Gary See this page
> >> >> >>> http://www.rondebruin.nl/ribbon.htm
> >> >> >>>
> >> >> >>> Download the example workbooks (point 2)
> >> >> >>>
> >> >> >>>
> >> >> >>> -- 
> >> >> >>>
> >> >> >>> Regards Ron de Bruin
> >> >> >>> http://www.rondebruin.nl/tips.htm
> >> >> >>>
> >> >> >>>
> >> >> >>> "Gary Nguyen" <GaryNguyen@discussions.microsoft.com> wrote in message
> >> >> >>> news:83282C54-B825-482F-81E1-74919B76A189@microsoft.com...
> >> >> >>> > I'm looking for a way to disable Office Menu controls such as: New, Save, SaveAs, etc on the fly. Whenever user opens an
> >> >> >>> > excel
> >> >> >>> > workbook into my application, those controls under Office Menu are disable.
> >> >> >>> > In office 2003, I could do something like this when user opens their workbook in my application: With
> >> >> >>> > objExcel.CommandBars("Worksheet Menu Bar")
> >> >> >>> >       .Controls("&File").Controls("&New...").Enabled = False
> >> >> >>> >       .Controls("&File").Controls("&Open...").Enabled = False
> >> >> >>> >       .Controls("&File").Controls("&Close").Enabled = False
> >> >> >>> >
> >> >> >>> > Thanks
> >> >> >>>
> >> >>
> >> >>
> >>
> >> 
> 
> 
0
11/19/2008 9:52:03 PM
Reply:

Similar Artilces: