Is Ctrl + S and ThisWorkbook.Save the same?

trimmjens

New Member
Joined
Oct 26, 2012
Messages
44
Hi,

I'm trying to find out if there is any difference between ways of saving a workbook.

I have a userform that pops up before saving the workbook.

If I save the workbook using the save button, press Ctrl + S or use SendKeys("^"&"s") it is no problem.
But if I use ThisWorkbook.Save or ActiveWorkbook.Save the userform is not behaving the way it is supposed to.

How are there methods different?

Appreciate all answers.

-Thomas
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
what occurs with the activeworkbook.save that is different
 
Upvote 0
The userform has a progressbar with max value that equals Sheets.Count. The code protects each sheet one by one and adds 1 to the progressbar for each sheets. (For loop)
The Userform_Activate (where my protect code is) will not run if I use the ActiveWorkbook.Save method.
 
Upvote 0
could you not call the

sub something
.....
Userform_Activate
ActiveWorkbook.Save
...
exit sub
 
Upvote 0
Thank you for your time. I undertand your suggestion.
The problem is that I run the userform BeforeSave and the same userform AfterSave with different actions.

When I save the workbook the userform does some actions prior to saving the workbook and other actions after save.
I set a variable to decide which actions to run from Userform_Activate.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

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