Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assign a macro to a button | Excel Discussion (Misc queries) | |||
How do I Assign Macro to a button? | Charts and Charting in Excel | |||
Assign macro to button | Excel Programming | |||
Assign macro to button | Excel Programming | |||
Assign button to run macro | Excel Programming |