Assign Macro 2 a Button....confusion
Just laying out what I did. You said:
"I think it's the way you saved the copy."
How does the Save operation create the problem. please?
Regards.
"Dave Peterson" wrote in message
...
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
|