ActiveX Command Buttons Swapping Over After Execution

JohnGow383

Board Regular
Joined
Jul 6, 2021
Messages
141
Office Version
  1. 2013
Platform
  1. Windows
Hello,

I have a very strange problem. I have a workbook with multiple sheets, mostly the months of the year. Each sheet has an active x command button used for printing a blank sheet.
On December sheet, there is a 2nd button (CommandButton_2) which is used to archive the entire workbook and save it to another location as a macrofree workbook.
In order to remove the redundant command buttons (shapes) in the archived wb each sheet is unprotected temporarily using a loop before removal.
After saving the macro-enabled workbook, when I re-open, CommandButton_1 is not No 2 and vice versa.
CommandButton_2 also has it's caption dynamically changing with the year upon each archive.

Has anyone ever seen this strange phenomonon as I can't work out what's going on. If anyone is willing to share any info or experiences I'd be happy to share the code for each button.

Thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
*It should read, commandbutton1 is now 2 and vice versa. So the archive button now runs the print code and the the print button runs the archive.
When i do archive again, save and close and re-open they swap over again and so on. What could be causing this?

It annoys me as I dont really want to have to use a FormControl button but I may be forced to.
Hello,

I have a very strange problem. I have a workbook with multiple sheets, mostly the months of the year. Each sheet has an active x command button used for printing a blank sheet.
On December sheet, there is a 2nd button (CommandButton_2) which is used to archive the entire workbook and save it to another location as a macrofree workbook.
In order to remove the redundant command buttons (shapes) in the archived wb each sheet is unprotected temporarily using a loop before removal.
After saving the macro-enabled workbook, when I re-open, CommandButton_1 is not No 2 and vice versa.
CommandButton_2 also has it's caption dynamically changing with the year upon each archive.

Has anyone ever seen this strange phenomonon as I can't work out what's going on. If anyone is willing to share any info or experiences I'd be happy to share the code for each button.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

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