A macro button opens a document it was recorded on.

Levi22

New Member
Joined
Feb 27, 2014
Messages
26
Hi guys

I have assigned a Macro to a Button. I run a Macro to copy all worksheets to a new book before i start working on it.
The Macro that i run also closes the Origianal book and only leaves the copy open.

Now, there is a Macro Button in the original document. The button copies correctly to the new book but when I click on it, it opens the original book, and I don't want it to do that.

Can anyone please help.

Regards,

Nyiko
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Depending on how you name the new file, if you are copying ALL worksheets to a new file, and you want the button to do the same thing it does in the original file, couldn't you accomplish this by just doing a SaveAS in your Macro?
 
Upvote 0
Nyiko

Assign the macro in the copied workbook to the button.
 
Upvote 0
Hi Red

I have other books which are linked to the original book and I am still a Newby when it comes to Macros and I don't want to mess the Macro that i already have.

I thought maybe there was a way around it.
 
Upvote 0
Norie.

That would work if i was the only one using the original. I am creating a costing tool for my department. A copy of the original is created whenever there is new project. So i am not the one workin on it.
 
Upvote 0
hi Norie.

I have used 'ActiveX Controls' instead of 'Form controls' to add my code, and that solved my problem.

Now I can copy all sheets and the copied Button doesn't open the original book anymore.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,932
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top