Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Assign Macro 2 a Button....confusion

This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each assigned to
a specific routine. Generally button1 assigned to General_Button1_Click etc.

I checked that this was the case, then saved the workbook to my C drive. I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared that
the file could not be found. I right-clicked the button and selected "assign
macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Assign Macro 2 a Button....confusion

not sure exactly what you're seeing, but did you copy the xls file to the
cd? if so, it is read only and when you copied it to the other computer it
would still be read only. make sure you changed the attributes. if i use a
cd, i always zip the file and copy the zip file to the cd. this way, the
files attributes are preserved.

if this isn't the case, sorry.

--


Gary


"Stuart" wrote in message
...
This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each assigned
to a specific routine. Generally button1 assigned to General_Button1_Click
etc.

I checked that this was the case, then saved the workbook to my C drive. I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared
that the file could not be found. I right-clicked the button and selected
"assign macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign Macro 2 a Button....confusion

You can assign the macros to the new workbook (manually or via code).

But another option is to use a button from the Control Toolbox Toolbar. Then
double click on that button and plop your code in there.

This type of commandbutton won't suffer the same problem as the Forms toolbar
button.

Stuart wrote:

This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each assigned to
a specific routine. Generally button1 assigned to General_Button1_Click etc.

I checked that this was the case, then saved the workbook to my C drive. I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared that
the file could not be found. I right-clicked the button and selected "assign
macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Assign Macro 2 a Button....confusion

You can assign the macros to the new workbook (manually or via code).
Yes, that's what I had to do.

I'm still confused as to what happened.
Firstly, that xla is only on my machine. Secondly, I checked the workbook
that I copied, and it clearly shows the buttons to be associated with
General_Button1_Click, General_Button2_Click and General_Button3_Click.

Is this a known issue? In the meantime, next time I had better follow your
Control Toolbox suggestion.

Thanks and Regards.

"Dave Peterson" wrote in message
...
You can assign the macros to the new workbook (manually or via code).

But another option is to use a button from the Control Toolbox Toolbar.
Then
double click on that button and plop your code in there.

This type of commandbutton won't suffer the same problem as the Forms
toolbar
button.

Stuart wrote:

This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each assigned
to
a specific routine. Generally button1 assigned to General_Button1_Click
etc.

I checked that this was the case, then saved the workbook to my C drive.
I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared
that
the file could not be found. I right-clicked the button and selected
"assign
macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign Macro 2 a Button....confusion

I think it's the way you saved the copy.

And it's a known behavior--not sure if it's an issue <bg.

Stuart wrote:

You can assign the macros to the new workbook (manually or via code).

Yes, that's what I had to do.

I'm still confused as to what happened.
Firstly, that xla is only on my machine. Secondly, I checked the workbook
that I copied, and it clearly shows the buttons to be associated with
General_Button1_Click, General_Button2_Click and General_Button3_Click.

Is this a known issue? In the meantime, next time I had better follow your
Control Toolbox suggestion.

Thanks and Regards.

"Dave Peterson" wrote in message
...
You can assign the macros to the new workbook (manually or via code).

But another option is to use a button from the Control Toolbox Toolbar.
Then
double click on that button and plop your code in there.

This type of commandbutton won't suffer the same problem as the Forms
toolbar
button.

Stuart wrote:

This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each assigned
to
a specific routine. Generally button1 assigned to General_Button1_Click
etc.

I checked that this was the case, then saved the workbook to my C drive.
I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared
that
the file could not be found. I right-clicked the button and selected
"assign
macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Assign Macro 2 a Button....confusion

Okay, I take your point !

Please consider this, then:

I created the workbook and code on my machine.
I saved the workbook to my machine and quit excel.
In Windows, I copied the file to a cd and transferred the cd to
the colleague's machine.
On the colleague's machine, I copied the file to their C drive.
When I opened it, the assignments had changed (as I described)
.... yet they were preserved on MY saved file.

Regards.

"Dave Peterson" wrote in message
...
I think it's the way you saved the copy.

And it's a known behavior--not sure if it's an issue <bg.

Stuart wrote:

You can assign the macros to the new workbook (manually or via code).

Yes, that's what I had to do.

I'm still confused as to what happened.
Firstly, that xla is only on my machine. Secondly, I checked the workbook
that I copied, and it clearly shows the buttons to be associated with
General_Button1_Click, General_Button2_Click and General_Button3_Click.

Is this a known issue? In the meantime, next time I had better follow
your
Control Toolbox suggestion.

Thanks and Regards.

"Dave Peterson" wrote in message
...
You can assign the macros to the new workbook (manually or via code).

But another option is to use a button from the Control Toolbox Toolbar.
Then
double click on that button and plop your code in there.

This type of commandbutton won't suffer the same problem as the Forms
toolbar
button.

Stuart wrote:

This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each
assigned
to
a specific routine. Generally button1 assigned to
General_Button1_Click
etc.

I checked that this was the case, then saved the workbook to my C
drive.
I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared
that
the file could not be found. I right-clicked the button and selected
"assign
macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.

--

Dave Peterson


--

Dave Peterson



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign Macro 2 a Button....confusion

So there's a difference between the way you saved -- File|SaveAs vs windows
explorer (copying|pasting)????

Stuart wrote:

Okay, I take your point !

Please consider this, then:

I created the workbook and code on my machine.
I saved the workbook to my machine and quit excel.
In Windows, I copied the file to a cd and transferred the cd to
the colleague's machine.
On the colleague's machine, I copied the file to their C drive.
When I opened it, the assignments had changed (as I described)
... yet they were preserved on MY saved file.

Regards.

"Dave Peterson" wrote in message
...
I think it's the way you saved the copy.

And it's a known behavior--not sure if it's an issue <bg.

Stuart wrote:

You can assign the macros to the new workbook (manually or via code).
Yes, that's what I had to do.

I'm still confused as to what happened.
Firstly, that xla is only on my machine. Secondly, I checked the workbook
that I copied, and it clearly shows the buttons to be associated with
General_Button1_Click, General_Button2_Click and General_Button3_Click.

Is this a known issue? In the meantime, next time I had better follow
your
Control Toolbox suggestion.

Thanks and Regards.

"Dave Peterson" wrote in message
...
You can assign the macros to the new workbook (manually or via code).

But another option is to use a button from the Control Toolbox Toolbar.
Then
double click on that button and plop your code in there.

This type of commandbutton won't suffer the same problem as the Forms
toolbar
button.

Stuart wrote:

This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each
assigned
to
a specific routine. Generally button1 assigned to
General_Button1_Click
etc.

I checked that this was the case, then saved the workbook to my C
drive.
I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared
that
the file could not be found. I right-clicked the button and selected
"assign
macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Assign Macro 2 a Button....confusion

Stuart wrote:
This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each assigned to
a specific routine. Generally button1 assigned to General_Button1_Click etc.

I checked that this was the case, then saved the workbook to my C drive. I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared that
the file could not be found. I right-clicked the button and selected "assign
macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.


-------------------

I'm assuming you're talking about a button on a sheet, not in a tool bar.

In you original setup, when you right click the button and click on assign macro
it shows you a list of macros. If you click on the drop down "Macros In:"
window and select "This Workbook", do you still see the macro name you expect to
find?

Bill
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Assign Macro 2 a Button....confusion

Stuart wrote:
This has just happened and I'm stumped as to why:

Opened a workbook on my machine. Each sheet has 3 buttons, each assigned to
a specific routine. Generally button1 assigned to General_Button1_Click etc.

I checked that this was the case, then saved the workbook to my C drive. I
then copied it to a CD-Rom.
On a Colleague's machine, I copied it to a folder on their C drive.

I opened the workbook. When I clicked a button, a message box declared that
the file could not be found. I right-clicked the button and selected "assign
macro".

The assignment box did not show General_Button1_Click
it showed
F:\Add-Ins\MasterEstimateBofQCode.xla!_
General_Button1_Click

I checked the original on my machine and that seems to just have
General_Button1_Click in the assignment box.

Confused.

Regards.


-------------------

From some of what you said, I'm assuming you're talking about a button on a
sheet, not in a tool bar?

In you original setup, when you right click the button and click on assign macro
it shows you a list of macros. If you click on the drop down "Macros In:"
window and select "This Workbook", do you still see the macro name you expect to
find? I'm questioning whether it's actually stored in your Personal.XLS or
something in the original setup.

Also I wonder if you've accidentally used a routine name that also exists in the
Add-In on the other machine. You should be able to get around that though by
looking only for names in your workbook (via the drop down) on the second
machine. Or alternatively try renaming your button routine slightly so there is
no conflict.

Bill
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
Assign a macro to a button totofab Excel Discussion (Misc queries) 4 December 13th 07 06:16 PM
How do I Assign Macro to a button? BellExcel Charts and Charting in Excel 4 May 20th 05 07:21 PM
Assign macro to button Bob Phillips[_6_] Excel Programming 0 May 24th 04 04:27 PM
Assign macro to button Frank Kabel Excel Programming 0 May 24th 04 04:03 PM
Assign button to run macro jamie85[_5_] Excel Programming 8 February 3rd 04 01:44 PM


All times are GMT +1. The time now is 02:17 AM.

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"