Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros Not In Toolbars
Greetings,
I'm using Excel 2003 and a while back I posted a request for how to do some calculations and combining. I got some great suggestions for macros and implemented them. They work great, too! So, I assigned them to toolbar buttons and removed most other toolbars and icons (Very limited application macros) so that when people use that spreadsheet, they see exactly what they need, nothing more. I posted the spreadsheet on our shared drive for everyone to use. Unfortunately, it seems that now, no matter what spreadsheet I open, I get those toolbar buttons and the ones I removed for that one spreadsheet are removed on my local Excel. I"m guessing I didn't save the macros as 'accessible only on that spreadsheet' or something, too. So I have to wonder... how can I make the macros 'button accessible' to everyone but only on THAT spreadsheet? Perhaps a way of adding a button to the spreadsheet itself? Any ideas would be appreciated. Thanks, Shane |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros Not In Toolbars
Since you remove the other toolbars as part of your code, you have to
reinstate them before your sheet closes, possibly as part of your Worksheet_BeforeClose event. By the same token, you have to remove the custom toolbar, which you activated as part of opening your file. Not knowing what exactly you created and removed, I am not clever enough to quote the code you should use. -- Hth Kassie Kasselman "SV" wrote: Greetings, I'm using Excel 2003 and a while back I posted a request for how to do some calculations and combining. I got some great suggestions for macros and implemented them. They work great, too! So, I assigned them to toolbar buttons and removed most other toolbars and icons (Very limited application macros) so that when people use that spreadsheet, they see exactly what they need, nothing more. I posted the spreadsheet on our shared drive for everyone to use. Unfortunately, it seems that now, no matter what spreadsheet I open, I get those toolbar buttons and the ones I removed for that one spreadsheet are removed on my local Excel. I"m guessing I didn't save the macros as 'accessible only on that spreadsheet' or something, too. So I have to wonder... how can I make the macros 'button accessible' to everyone but only on THAT spreadsheet? Perhaps a way of adding a button to the spreadsheet itself? Any ideas would be appreciated. Thanks, Shane |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros Not In Toolbars
Kassie,
Hmm.. well... I didn't use much code beyond a macro to combine the contents of a given cell. I'm too new to macros to even know what a 'beforeClose event is. I did, however, customize the toolbars to show the Macros toolbar with two buttons I created. The problem seems to be that by customizing my toolbar in that worksheet (to show the Macros toolbar, with my custom buttons), I made it so Excel always shows that toolbar, even if those macros don't exist in the new worksheet. I'm accustomed to Word's template file and being able to make different templates and link documents to them. With that, I can open up one document linked to one template and another document linked to another. I see 'template files' for excel, but I don't see how you link a given spreadsheet to the template. Do you know if there's a way to set up Excel's toolbars and save a template file such that when we open the workbook in the shared directory it shows the 'special' toolbar, but when we open our own Excel documents it shows our 'usual' toolbars??? Thanks, Shane "kassie" (Change xxx to hotmail) wrote in message ... Since you remove the other toolbars as part of your code, you have to reinstate them before your sheet closes, possibly as part of your Worksheet_BeforeClose event. By the same token, you have to remove the custom toolbar, which you activated as part of opening your file. Not knowing what exactly you created and removed, I am not clever enough to quote the code you should use. -- Hth Kassie Kasselman "SV" wrote: Greetings, I'm using Excel 2003 and a while back I posted a request for how to do some calculations and combining. I got some great suggestions for macros and implemented them. They work great, too! So, I assigned them to toolbar buttons and removed most other toolbars and icons (Very limited application macros) so that when people use that spreadsheet, they see exactly what they need, nothing more. I posted the spreadsheet on our shared drive for everyone to use. Unfortunately, it seems that now, no matter what spreadsheet I open, I get those toolbar buttons and the ones I removed for that one spreadsheet are removed on my local Excel. I"m guessing I didn't save the macros as 'accessible only on that spreadsheet' or something, too. So I have to wonder... how can I make the macros 'button accessible' to everyone but only on THAT spreadsheet? Perhaps a way of adding a button to the spreadsheet itself? Any ideas would be appreciated. Thanks, Shane |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros Not In Toolbars
You have correctly diagnosed your problem! Yes, if you manually create a
toolbar, it will be there until you remove it! Ideally, you should create and activate custom toolbars or buttons through code on opening your workbook, and then again remove them, using code. on closing your workbook You can right click on the Excel logo (top left), click on View Code, in the right hand pane select Workbook in the left box, and a Workbook_open macro will be initialised. You can paste the following there, between the name and End Sub Dim tBar, newButton 'Delete CommandBar if it exists On Error Resume Next CommandBars("Special Task").Delete On Error GoTo 0 'create CommandBar CommandBars.Add Name:="Special Task" 'define an object variable to refer to the CommandBar Set tBar = CommandBars("Special Task") 'add first button Set newButton = tBar ..Controls.Add(Id:=2950) 'specify tooltip (name), macro to run, and status bar text for the macro With newButton .OnAction = "AddInfo" .Caption = "Add Info" End With 'add next button. Set newButton = tBar.Controls.Add With newButton .Caption = "Remove Information" .OnAction = "RemoveInfo" .FaceId = 278 .BeginGroup = True End With 'display CommandBar, position on spreadsheet tBar.Visible = True With CommandBars("Special Task") .Left = 200 .Top = 200 End With Obviously this is sample code, and you will have to adapt to suit your needs. Then click on the down arrow of the box on the right, and select Before_Close. After before close, and before end sub, enter the following; CommandBars("Special Task").Delete to remove the toolbar. Not much ehlp if you do not know about macros though! With more info from your part, maybe someone here will be able to help you a lot better. By the way, this example was taken from Visual Basic Macros Made Easy. -- Hth Kassie Kasselman "SV" wrote: Kassie, Hmm.. well... I didn't use much code beyond a macro to combine the contents of a given cell. I'm too new to macros to even know what a 'beforeClose event is. I did, however, customize the toolbars to show the Macros toolbar with two buttons I created. The problem seems to be that by customizing my toolbar in that worksheet (to show the Macros toolbar, with my custom buttons), I made it so Excel always shows that toolbar, even if those macros don't exist in the new worksheet. I'm accustomed to Word's template file and being able to make different templates and link documents to them. With that, I can open up one document linked to one template and another document linked to another. I see 'template files' for excel, but I don't see how you link a given spreadsheet to the template. Do you know if there's a way to set up Excel's toolbars and save a template file such that when we open the workbook in the shared directory it shows the 'special' toolbar, but when we open our own Excel documents it shows our 'usual' toolbars??? Thanks, Shane "kassie" (Change xxx to hotmail) wrote in message ... Since you remove the other toolbars as part of your code, you have to reinstate them before your sheet closes, possibly as part of your Worksheet_BeforeClose event. By the same token, you have to remove the custom toolbar, which you activated as part of opening your file. Not knowing what exactly you created and removed, I am not clever enough to quote the code you should use. -- Hth Kassie Kasselman "SV" wrote: Greetings, I'm using Excel 2003 and a while back I posted a request for how to do some calculations and combining. I got some great suggestions for macros and implemented them. They work great, too! So, I assigned them to toolbar buttons and removed most other toolbars and icons (Very limited application macros) so that when people use that spreadsheet, they see exactly what they need, nothing more. I posted the spreadsheet on our shared drive for everyone to use. Unfortunately, it seems that now, no matter what spreadsheet I open, I get those toolbar buttons and the ones I removed for that one spreadsheet are removed on my local Excel. I"m guessing I didn't save the macros as 'accessible only on that spreadsheet' or something, too. So I have to wonder... how can I make the macros 'button accessible' to everyone but only on THAT spreadsheet? Perhaps a way of adding a button to the spreadsheet itself? Any ideas would be appreciated. Thanks, Shane |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros Not In Toolbars
Kassie,
I do apprecaite the info, I'll take a look and dig in. I don't know much about them, but I seem to have a knack for at least grasping the more simple ones! Shane "kassie" (Change xxx to hotmail) wrote in message ... You have correctly diagnosed your problem! Yes, if you manually create a toolbar, it will be there until you remove it! Ideally, you should create and activate custom toolbars or buttons through code on opening your workbook, and then again remove them, using code. on closing your workbook You can right click on the Excel logo (top left), click on View Code, in the right hand pane select Workbook in the left box, and a Workbook_open macro will be initialised. You can paste the following there, between the name and End Sub Dim tBar, newButton 'Delete CommandBar if it exists On Error Resume Next CommandBars("Special Task").Delete On Error GoTo 0 'create CommandBar CommandBars.Add Name:="Special Task" 'define an object variable to refer to the CommandBar Set tBar = CommandBars("Special Task") 'add first button Set newButton = tBar .Controls.Add(Id:=2950) 'specify tooltip (name), macro to run, and status bar text for the macro With newButton .OnAction = "AddInfo" .Caption = "Add Info" End With 'add next button. Set newButton = tBar.Controls.Add With newButton .Caption = "Remove Information" .OnAction = "RemoveInfo" .FaceId = 278 .BeginGroup = True End With 'display CommandBar, position on spreadsheet tBar.Visible = True With CommandBars("Special Task") .Left = 200 .Top = 200 End With Obviously this is sample code, and you will have to adapt to suit your needs. Then click on the down arrow of the box on the right, and select Before_Close. After before close, and before end sub, enter the following; CommandBars("Special Task").Delete to remove the toolbar. Not much ehlp if you do not know about macros though! With more info from your part, maybe someone here will be able to help you a lot better. By the way, this example was taken from Visual Basic Macros Made Easy. -- Hth Kassie Kasselman "SV" wrote: Kassie, Hmm.. well... I didn't use much code beyond a macro to combine the contents of a given cell. I'm too new to macros to even know what a 'beforeClose event is. I did, however, customize the toolbars to show the Macros toolbar with two buttons I created. The problem seems to be that by customizing my toolbar in that worksheet (to show the Macros toolbar, with my custom buttons), I made it so Excel always shows that toolbar, even if those macros don't exist in the new worksheet. I'm accustomed to Word's template file and being able to make different templates and link documents to them. With that, I can open up one document linked to one template and another document linked to another. I see 'template files' for excel, but I don't see how you link a given spreadsheet to the template. Do you know if there's a way to set up Excel's toolbars and save a template file such that when we open the workbook in the shared directory it shows the 'special' toolbar, but when we open our own Excel documents it shows our 'usual' toolbars??? Thanks, Shane "kassie" (Change xxx to hotmail) wrote in message ... Since you remove the other toolbars as part of your code, you have to reinstate them before your sheet closes, possibly as part of your Worksheet_BeforeClose event. By the same token, you have to remove the custom toolbar, which you activated as part of opening your file. Not knowing what exactly you created and removed, I am not clever enough to quote the code you should use. -- Hth Kassie Kasselman "SV" wrote: Greetings, I'm using Excel 2003 and a while back I posted a request for how to do some calculations and combining. I got some great suggestions for macros and implemented them. They work great, too! So, I assigned them to toolbar buttons and removed most other toolbars and icons (Very limited application macros) so that when people use that spreadsheet, they see exactly what they need, nothing more. I posted the spreadsheet on our shared drive for everyone to use. Unfortunately, it seems that now, no matter what spreadsheet I open, I get those toolbar buttons and the ones I removed for that one spreadsheet are removed on my local Excel. I"m guessing I didn't save the macros as 'accessible only on that spreadsheet' or something, too. So I have to wonder... how can I make the macros 'button accessible' to everyone but only on THAT spreadsheet? Perhaps a way of adding a button to the spreadsheet itself? Any ideas would be appreciated. Thanks, Shane |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros Not In Toolbars
If you do not succeed, post back!
-- Hth Kassie Kasselman "SV" wrote: Kassie, I do apprecaite the info, I'll take a look and dig in. I don't know much about them, but I seem to have a knack for at least grasping the more simple ones! Shane "kassie" (Change xxx to hotmail) wrote in message ... You have correctly diagnosed your problem! Yes, if you manually create a toolbar, it will be there until you remove it! Ideally, you should create and activate custom toolbars or buttons through code on opening your workbook, and then again remove them, using code. on closing your workbook You can right click on the Excel logo (top left), click on View Code, in the right hand pane select Workbook in the left box, and a Workbook_open macro will be initialised. You can paste the following there, between the name and End Sub Dim tBar, newButton 'Delete CommandBar if it exists On Error Resume Next CommandBars("Special Task").Delete On Error GoTo 0 'create CommandBar CommandBars.Add Name:="Special Task" 'define an object variable to refer to the CommandBar Set tBar = CommandBars("Special Task") 'add first button Set newButton = tBar .Controls.Add(Id:=2950) 'specify tooltip (name), macro to run, and status bar text for the macro With newButton .OnAction = "AddInfo" .Caption = "Add Info" End With 'add next button. Set newButton = tBar.Controls.Add With newButton .Caption = "Remove Information" .OnAction = "RemoveInfo" .FaceId = 278 .BeginGroup = True End With 'display CommandBar, position on spreadsheet tBar.Visible = True With CommandBars("Special Task") .Left = 200 .Top = 200 End With Obviously this is sample code, and you will have to adapt to suit your needs. Then click on the down arrow of the box on the right, and select Before_Close. After before close, and before end sub, enter the following; CommandBars("Special Task").Delete to remove the toolbar. Not much ehlp if you do not know about macros though! With more info from your part, maybe someone here will be able to help you a lot better. By the way, this example was taken from Visual Basic Macros Made Easy. -- Hth Kassie Kasselman "SV" wrote: Kassie, Hmm.. well... I didn't use much code beyond a macro to combine the contents of a given cell. I'm too new to macros to even know what a 'beforeClose event is. I did, however, customize the toolbars to show the Macros toolbar with two buttons I created. The problem seems to be that by customizing my toolbar in that worksheet (to show the Macros toolbar, with my custom buttons), I made it so Excel always shows that toolbar, even if those macros don't exist in the new worksheet. I'm accustomed to Word's template file and being able to make different templates and link documents to them. With that, I can open up one document linked to one template and another document linked to another. I see 'template files' for excel, but I don't see how you link a given spreadsheet to the template. Do you know if there's a way to set up Excel's toolbars and save a template file such that when we open the workbook in the shared directory it shows the 'special' toolbar, but when we open our own Excel documents it shows our 'usual' toolbars??? Thanks, Shane "kassie" (Change xxx to hotmail) wrote in message ... Since you remove the other toolbars as part of your code, you have to reinstate them before your sheet closes, possibly as part of your Worksheet_BeforeClose event. By the same token, you have to remove the custom toolbar, which you activated as part of opening your file. Not knowing what exactly you created and removed, I am not clever enough to quote the code you should use. -- Hth Kassie Kasselman "SV" wrote: Greetings, I'm using Excel 2003 and a while back I posted a request for how to do some calculations and combining. I got some great suggestions for macros and implemented them. They work great, too! So, I assigned them to toolbar buttons and removed most other toolbars and icons (Very limited application macros) so that when people use that spreadsheet, they see exactly what they need, nothing more. I posted the spreadsheet on our shared drive for everyone to use. Unfortunately, it seems that now, no matter what spreadsheet I open, I get those toolbar buttons and the ones I removed for that one spreadsheet are removed on my local Excel. I"m guessing I didn't save the macros as 'accessible only on that spreadsheet' or something, too. So I have to wonder... how can I make the macros 'button accessible' to everyone but only on THAT spreadsheet? Perhaps a way of adding a button to the spreadsheet itself? Any ideas would be appreciated. Thanks, Shane |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving custom toolbars with macros to work on other computers | Excel Discussion (Misc queries) | |||
Macros Don't Show On Commands List and 'Normal.dot' | Excel Worksheet Functions | |||
Macros and Toolbars | Excel Discussion (Misc queries) | |||
Transferring toolbars and macros to other machines | Excel Discussion (Misc queries) | |||
Transferring toolbars and macros to other computers | Excel Discussion (Misc queries) |