Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Custom button starts new instance of Excel

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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Custom button starts new instance of Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Custom button starts new instance of Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Custom button starts new instance of Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Custom button starts new instance of Excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Custom button starts new instance of Excel

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
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
Excel E-2007 starts, but Installer also starts 3 times??? Thanks for the Great Tip Setting up and Configuration of Excel 0 January 24th 10 03:21 AM
2003 - 2007 custom macro and custom button restore. Scott Sornberger Excel Discussion (Misc queries) 11 May 23rd 08 02:41 PM
distributing an Excel custom button [email protected] Excel Discussion (Misc queries) 2 March 28th 07 02:12 PM
Can I make a custom button in Excel for the Group feature? Lisa Excel Worksheet Functions 1 December 20th 04 09:34 PM
Delete a custom button by holding down the ALT key and dragging the button off the toolbar Stephen[_8_] Excel Programming 0 April 4th 04 02:22 PM


All times are GMT +1. The time now is 01:50 PM.

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

About Us

"It's about Microsoft Excel"