Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Toolbar for a specific workbook

Hi,
I have some macros that shall only run in a specific workbook. I have made a
toolobar form those macros but I can not make the toolbar appear only when
opening that special workbook. I also want the toolbar to disappear when
closing the workbook.

Thanks for all help


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Toolbar for a specific workbook

If you add MyworkbookName = ThisWorkbook.name to the beginning of the macro.

then add an if statement at the begfinning of the macro

if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then


end if



"Prixton" wrote:

Hi,
I have some macros that shall only run in a specific workbook. I have made a
toolobar form those macros but I can not make the toolbar appear only when
opening that special workbook. I also want the toolbar to disappear when
closing the workbook.

Thanks for all help



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Do not understand

Hi Joel,
Thanks for your answer. However I do not understand it.
If my workbook is called aaa.xls and my toolbar is called MyToolbar, how
should the commands be in the macro?

Thanks again

"Joel" skrev i meddelandet
...
If you add MyworkbookName = ThisWorkbook.name to the beginning of the
macro.

then add an if statement at the begfinning of the macro

if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then


end if



"Prixton" wrote:

Hi,
I have some macros that shall only run in a specific workbook. I have
made a
toolobar form those macros but I can not make the toolbar appear only
when
opening that special workbook. I also want the toolbar to disappear when
closing the workbook.

Thanks for all help





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Do not understand

Yuou have to look at macros in the tools - Macros - visual Basic editor.

You said you wanted tthe macro which work with the tool bar only to run when
the workbook has a certain name. The tool bars are inside the spreadsheet.

It is like the Workbook is the Family Jones.
Each worksheet (tab) has a name Alice, Bob, Nancy
The Toolbars also have name Thom.

If you name the Workbook Smith you will still have worksheets Alice, Bob,
Nancy, but you won't have toolbar Thom.

bob Jones

"Prixton" wrote:

Hi Joel,
Thanks for your answer. However I do not understand it.
If my workbook is called aaa.xls and my toolbar is called MyToolbar, how
should the commands be in the macro?

Thanks again

"Joel" skrev i meddelandet
...
If you add MyworkbookName = ThisWorkbook.name to the beginning of the
macro.

then add an if statement at the begfinning of the macro

if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then


end if



"Prixton" wrote:

Hi,
I have some macros that shall only run in a specific workbook. I have
made a
toolobar form those macros but I can not make the toolbar appear only
when
opening that special workbook. I also want the toolbar to disappear when
closing the workbook.

Thanks for all help






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Do not understand

Hi Joel,

I am sorry but I still do not understand.

Here is my macro and let us say that my workbook is called Smith.exe, should
the toolbar be called Smith as well?



Here is my macro:

Sub Compress()

'

' Compress Macro

' Macro recorded 2007-02-22 by Gunnel Bengtsson

'

' Keyboard Shortcut: Ctrl+q

'

ActiveSheet.Rows.RowHeight = 13



End Sub

Sub Expand()

'

' Expand Macro

' Macro recorded 2007-02-22 by Prixton

'

' Keyboard Shortcut: Ctrl+e

'

ActiveSheet.Rows.AutoFit



End Sub



How should I complete it?



Thanks again for your help even if I am slow and do not understand



"Joel" skrev i meddelandet
...
Yuou have to look at macros in the tools - Macros - visual Basic editor.

You said you wanted tthe macro which work with the tool bar only to run
when
the workbook has a certain name. The tool bars are inside the
spreadsheet.

It is like the Workbook is the Family Jones.
Each worksheet (tab) has a name Alice, Bob, Nancy
The Toolbars also have name Thom.

If you name the Workbook Smith you will still have worksheets Alice, Bob,
Nancy, but you won't have toolbar Thom.

bob Jones

"Prixton" wrote:

Hi Joel,
Thanks for your answer. However I do not understand it.
If my workbook is called aaa.xls and my toolbar is called MyToolbar, how
should the commands be in the macro?

Thanks again

"Joel" skrev i meddelandet
...
If you add MyworkbookName = ThisWorkbook.name to the beginning of the
macro.

then add an if statement at the begfinning of the macro

if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then


end if



"Prixton" wrote:

Hi,
I have some macros that shall only run in a specific workbook. I have
made a
toolobar form those macros but I can not make the toolbar appear only
when
opening that special workbook. I also want the toolbar to disappear
when
closing the workbook.

Thanks for all help










  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Do not understand

here is one example for the Sub Compress. Replace runwiththisname.xls with
your worksheet name. When Ctrl Q is press will only work when the workbook
is named runwiththisname.xls

Sub Compress()

'

' Compress Macro

' Macro recorded 2007-02-22 by Gunnel Bengtsson

'

' Keyboard Shortcut: Ctrl+q

'
if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then
ActiveSheet.Rows.RowHeight = 13
end if

End Sub

"Prixton" wrote:

Hi Joel,

I am sorry but I still do not understand.

Here is my macro and let us say that my workbook is called Smith.exe, should
the toolbar be called Smith as well?



Here is my macro:

Sub Compress()

'

' Compress Macro

' Macro recorded 2007-02-22 by Gunnel Bengtsson

'

' Keyboard Shortcut: Ctrl+q

'

ActiveSheet.Rows.RowHeight = 13



End Sub

Sub Expand()

'

' Expand Macro

' Macro recorded 2007-02-22 by Prixton

'

' Keyboard Shortcut: Ctrl+e

'

ActiveSheet.Rows.AutoFit



End Sub



How should I complete it?



Thanks again for your help even if I am slow and do not understand



"Joel" skrev i meddelandet
...
Yuou have to look at macros in the tools - Macros - visual Basic editor.

You said you wanted tthe macro which work with the tool bar only to run
when
the workbook has a certain name. The tool bars are inside the
spreadsheet.

It is like the Workbook is the Family Jones.
Each worksheet (tab) has a name Alice, Bob, Nancy
The Toolbars also have name Thom.

If you name the Workbook Smith you will still have worksheets Alice, Bob,
Nancy, but you won't have toolbar Thom.

bob Jones

"Prixton" wrote:

Hi Joel,
Thanks for your answer. However I do not understand it.
If my workbook is called aaa.xls and my toolbar is called MyToolbar, how
should the commands be in the macro?

Thanks again

"Joel" skrev i meddelandet
...
If you add MyworkbookName = ThisWorkbook.name to the beginning of the
macro.

then add an if statement at the begfinning of the macro

if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then


end if



"Prixton" wrote:

Hi,
I have some macros that shall only run in a specific workbook. I have
made a
toolobar form those macros but I can not make the toolbar appear only
when
opening that special workbook. I also want the toolbar to disappear
when
closing the workbook.

Thanks for all help









  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Do not understand

Sorry Joel, but let me take this from the beginning.
I want a toolbar to appear when I open a certain workbook and disappear when
I close my workbook. I have made my macros and my toolbar. That is all



"Joel" skrev i meddelandet
...
here is one example for the Sub Compress. Replace runwiththisname.xls
with
your worksheet name. When Ctrl Q is press will only work when the
workbook
is named runwiththisname.xls

Sub Compress()

'

' Compress Macro

' Macro recorded 2007-02-22 by
'

' Keyboard Shortcut: Ctrl+q

'
if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then
ActiveSheet.Rows.RowHeight = 13
end if

End Sub

"Prixton" wrote:

Hi Joel,

I am sorry but I still do not understand.

Here is my macro and let us say that my workbook is called Smith.exe,
should
the toolbar be called Smith as well?



Here is my macro:

Sub Compress()

'

' Compress Macro

' Macro recorded 2007-02-22 by Gunnel Bengtsson

'

' Keyboard Shortcut: Ctrl+q

'

ActiveSheet.Rows.RowHeight = 13



End Sub

Sub Expand()

'

' Expand Macro

' Macro recorded 2007-02-22 by Prixton

'

' Keyboard Shortcut: Ctrl+e

'

ActiveSheet.Rows.AutoFit



End Sub



How should I complete it?



Thanks again for your help even if I am slow and do not understand



"Joel" skrev i meddelandet
...
Yuou have to look at macros in the tools - Macros - visual Basic
editor.

You said you wanted tthe macro which work with the tool bar only to run
when
the workbook has a certain name. The tool bars are inside the
spreadsheet.

It is like the Workbook is the Family Jones.
Each worksheet (tab) has a name Alice, Bob, Nancy
The Toolbars also have name Thom.

If you name the Workbook Smith you will still have worksheets Alice,
Bob,
Nancy, but you won't have toolbar Thom.

bob Jones

"Prixton" wrote:

Hi Joel,
Thanks for your answer. However I do not understand it.
If my workbook is called aaa.xls and my toolbar is called MyToolbar,
how
should the commands be in the macro?

Thanks again

"Joel" skrev i meddelandet
...
If you add MyworkbookName = ThisWorkbook.name to the beginning of
the
macro.

then add an if statement at the begfinning of the macro

if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then


end if



"Prixton" wrote:

Hi,
I have some macros that shall only run in a specific workbook. I
have
made a
toolobar form those macros but I can not make the toolbar appear
only
when
opening that special workbook. I also want the toolbar to disappear
when
closing the workbook.

Thanks for all help











  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Do not understand

The macros you gave me only activate the Hot Keys. they have nothing to do
with displaying toolbars.

I activated the chart toolbar and got the following macro

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/23/2007 by Joel Warburg
'

'
Application.CommandBars("Chart").Visible = True
End Sub


"Prixton" wrote:

Sorry Joel, but let me take this from the beginning.
I want a toolbar to appear when I open a certain workbook and disappear when
I close my workbook. I have made my macros and my toolbar. That is all



"Joel" skrev i meddelandet
...
here is one example for the Sub Compress. Replace runwiththisname.xls
with
your worksheet name. When Ctrl Q is press will only work when the
workbook
is named runwiththisname.xls

Sub Compress()

'

' Compress Macro

' Macro recorded 2007-02-22 by
'

' Keyboard Shortcut: Ctrl+q

'
if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then
ActiveSheet.Rows.RowHeight = 13
end if

End Sub

"Prixton" wrote:

Hi Joel,

I am sorry but I still do not understand.

Here is my macro and let us say that my workbook is called Smith.exe,
should
the toolbar be called Smith as well?



Here is my macro:

Sub Compress()

'

' Compress Macro

' Macro recorded 2007-02-22 by Gunnel Bengtsson

'

' Keyboard Shortcut: Ctrl+q

'

ActiveSheet.Rows.RowHeight = 13



End Sub

Sub Expand()

'

' Expand Macro

' Macro recorded 2007-02-22 by Prixton

'

' Keyboard Shortcut: Ctrl+e

'

ActiveSheet.Rows.AutoFit



End Sub



How should I complete it?



Thanks again for your help even if I am slow and do not understand



"Joel" skrev i meddelandet
...
Yuou have to look at macros in the tools - Macros - visual Basic
editor.

You said you wanted tthe macro which work with the tool bar only to run
when
the workbook has a certain name. The tool bars are inside the
spreadsheet.

It is like the Workbook is the Family Jones.
Each worksheet (tab) has a name Alice, Bob, Nancy
The Toolbars also have name Thom.

If you name the Workbook Smith you will still have worksheets Alice,
Bob,
Nancy, but you won't have toolbar Thom.

bob Jones

"Prixton" wrote:

Hi Joel,
Thanks for your answer. However I do not understand it.
If my workbook is called aaa.xls and my toolbar is called MyToolbar,
how
should the commands be in the macro?

Thanks again

"Joel" skrev i meddelandet
...
If you add MyworkbookName = ThisWorkbook.name to the beginning of
the
macro.

then add an if statement at the begfinning of the macro

if (strcomp(MyworkbookName, "runwiththisname.xls") = 0) then


end if



"Prixton" wrote:

Hi,
I have some macros that shall only run in a specific workbook. I
have
made a
toolobar form those macros but I can not make the toolbar appear
only
when
opening that special workbook. I also want the toolbar to disappear
when
closing the workbook.

Thanks for all help












  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Toolbar for a specific workbook

You will have to create the toolbar when the workbook opens and delete it when
the workbook closes.

Ususally done through Workbook_Open code in Thisworkbook module.

See Debra Dalgleish's site for instructions.

http://www.contextures.on.ca/xlToolbar02.html

You don't have to save the workbook as an add-in.


Gord Dibben MS Excel MVP

On Fri, 23 Feb 2007 12:51:02 GMT, "Prixton" wrote:

Hi,
I have some macros that shall only run in a specific workbook. I have made a
toolobar form those macros but I can not make the toolbar appear only when
opening that special workbook. I also want the toolbar to disappear when
closing the workbook.

Thanks for all help


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
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Excel Discussion (Misc queries) 1 March 16th 06 06:55 PM
Isolating a custom toolbar to a specific spreadsheet Gilgamesh Excel Discussion (Misc queries) 3 October 14th 05 01:30 PM
keeping a toolbar attached to a workbook Paul Ponzelli Excel Discussion (Misc queries) 0 August 12th 05 11:39 PM
Workbook Specific Toolbar Menus sjschmidtky Excel Discussion (Misc queries) 1 July 25th 05 04:53 PM
How can I attach a custom toolbar to only appear on one specific . ABuia Excel Worksheet Functions 1 January 18th 05 02:57 PM


All times are GMT +1. The time now is 03:14 PM.

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

About Us

"It's about Microsoft Excel"