Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
Isolating a custom toolbar to a specific spreadsheet | Excel Discussion (Misc queries) | |||
keeping a toolbar attached to a workbook | Excel Discussion (Misc queries) | |||
Workbook Specific Toolbar Menus | Excel Discussion (Misc queries) | |||
How can I attach a custom toolbar to only appear on one specific . | Excel Worksheet Functions |