Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This has me stumped, so any help will be deeply appreciated!
I built a form that creates a custom toolbar when the file opens to allow the user to run macros. Recently several new users have reported a series of errors when they click any of the custom buttons. I can't reproduce it on my computer but the errors sound like the buttons are trying to run the macros from a different workbook that doesn't exist. The users are prompted to "Enable Macros" a second time and then get a message that the macro can't be found. The users can, however, run the macro directly from the menu options, just not from the custom buttons. When I open the Assign Macro box, I see the current file name as a path in front of the macro name. Could that be causing the problem? I remember, sometime in the past, seeing only the macro name (no file name) in the Assign Macro box. I've used either Excel 2003 or Excel 2002 to edit the file, depending on which office I'm working in. I've tried setting the macro assignment to "This Workbook only", but the file name is still there. On my computer(s), the file name does change when I rename the file, so the buttons still find the right macro to run. I haven't pinned down a common attribute for the all users who have this error, but several work on US Government sites which have many security restrictions on software. Is it possible that network security is affecting the connection between the button and the macro? Any ideas? Thanks, EllenR |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
if the user can run the macro from the menu, that (to me) zeros in on the form. the file name appearing in front of the macro name indicate that the macro is not in the active file. at least on my pc. if i have 2 files open both with macros, the macro box shows only the macro name of the macros in the active file but show both file and macro names of the inactive file. i am still on 2k so i not sure how squirlly 2002 and 2003 is. -----Original Message----- This has me stumped, so any help will be deeply appreciated! I built a form that creates a custom toolbar when the file opens to allow the user to run macros. Recently several new users have reported a series of errors when they click any of the custom buttons. I can't reproduce it on my computer but the errors sound like the buttons are trying to run the macros from a different workbook that doesn't exist. The users are prompted to "Enable Macros" a second time and then get a message that the macro can't be found. The users can, however, run the macro directly from the menu options, just not from the custom buttons. When I open the Assign Macro box, I see the current file name as a path in front of the macro name. Could that be causing the problem? I remember, sometime in the past, seeing only the macro name (no file name) in the Assign Macro box. I've used either Excel 2003 or Excel 2002 to edit the file, depending on which office I'm working in. I've tried setting the macro assignment to "This Workbook only", but the file name is still there. On my computer(s), the file name does change when I rename the file, so the buttons still find the right macro to run. I haven't pinned down a common attribute for the all users who have this error, but several work on US Government sites which have many security restrictions on software. Is it possible that network security is affecting the connection between the button and the macro? Any ideas? Thanks, EllenR . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've seen this before. I assume you users have Office 2007. In that
version, if your code is run from a click event rather than being run directly by excel based on the value of the OnAction property of the button, you need to set the Cancel paramter to true even though the button is not a built-in feature of Excel. " wrote: hi, if the user can run the macro from the menu, that (to me) zeros in on the form. the file name appearing in front of the macro name indicate that the macro is not in the active file. at least on my pc. if i have 2 files open both with macros, the macro box shows only the macro name of the macros in the active file but show both file and macro names of the inactive file. i am still on 2k so i not sure how squirlly 2002 and 2003 is. -----Original Message----- This has me stumped, so any help will be deeply appreciated! I built a form that creates a custom toolbar when the file opens to allow the user to run macros. Recently several new users have reported a series of errors when they click any of the custom buttons. I can't reproduce it on my computer but the errors sound like the buttons are trying to run the macros from a different workbook that doesn't exist. The users are prompted to "Enable Macros" a second time and then get a message that the macro can't be found. The users can, however, run the macro directly from the menu options, just not from the custom buttons. When I open the Assign Macro box, I see the current file name as a path in front of the macro name. Could that be causing the problem? I remember, sometime in the past, seeing only the macro name (no file name) in the Assign Macro box. I've used either Excel 2003 or Excel 2002 to edit the file, depending on which office I'm working in. I've tried setting the macro assignment to "This Workbook only", but the file name is still there. On my computer(s), the file name does change when I rename the file, so the buttons still find the right macro to run. I haven't pinned down a common attribute for the all users who have this error, but several work on US Government sites which have many security restrictions on software. Is it possible that network security is affecting the connection between the button and the macro? Any ideas? Thanks, EllenR . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ellen
Are the macro's/the form in an addin? If not this is probably the way to go - don't use the Macro assign wizard but but just call a method (the macro) from the button click event from the form code (as you would in VB6). If the user has opened more than one file, which have macros of the same name Excel can get confused. If you put your macro code in an addin and reference the addin from the files themselves this may get around your problem. Though I have to say I've not come across the problem you have described. Hope you sort it. Mark |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've never worked with addins, so that will be a learning curve. Also, my
users at government sites may not be allowed to install an addin, so having the macros run from within the file is the easiest method...except when it doesn't work. I'm using the Commandbars commands to create the custom toolbar, rather than the old Toolbarbuttons commands. Would it be worth changing back to the old code, which worked fine for years? "MarkHG" wrote: Ellen Are the macro's/the form in an addin? If not this is probably the way to go - don't use the Macro assign wizard but but just call a method (the macro) from the button click event from the form code (as you would in VB6). If the user has opened more than one file, which have macros of the same name Excel can get confused. If you put your macro code in an addin and reference the addin from the files themselves this may get around your problem. Though I have to say I've not come across the problem you have described. Hope you sort it. Mark |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John Walkenbach has a technique to add items to the worksheet menubar at:
http://j-walk.com/ss/excel/tips/tip53.htm If you really want a toolbar, here's how I do it: http://groups.google.co.uk/groups?th...5B41%40msn.com It builds the toolbar when the workbook opens and deletes it when the workbook closes. EllenR wrote: I've never worked with addins, so that will be a learning curve. Also, my users at government sites may not be allowed to install an addin, so having the macros run from within the file is the easiest method...except when it doesn't work. I'm using the Commandbars commands to create the custom toolbar, rather than the old Toolbarbuttons commands. Would it be worth changing back to the old code, which worked fine for years? "MarkHG" wrote: Ellen Are the macro's/the form in an addin? If not this is probably the way to go - don't use the Macro assign wizard but but just call a method (the macro) from the button click event from the form code (as you would in VB6). If the user has opened more than one file, which have macros of the same name Excel can get confused. If you put your macro code in an addin and reference the addin from the files themselves this may get around your problem. Though I have to say I've not come across the problem you have described. Hope you sort it. Mark -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel E-2007 starts, but Installer also starts 3 times??? | Setting up and Configuration of Excel | |||
2003 - 2007 custom macro and custom button restore. | Excel Discussion (Misc queries) | |||
distributing an Excel custom button | Excel Discussion (Misc queries) | |||
Can I make a custom button in Excel for the Group feature? | Excel Worksheet Functions | |||
Delete a custom button by holding down the ALT key and dragging the button off the toolbar | Excel Programming |