Shared Workbook - macro

Mel L

Board Regular
Joined
Oct 14, 2004
Messages
50
I have a macro that saves data from one sheet to a shared workbook. Everything works great, but I get a pop up letting me know it's a shared workbook, etc and requires that I hit save. I want to add to my macro to automatically hit this save, so the user doesn't have to. Is there a simple piece of code I can add to my code to accomplish this?
 

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Mel L

Board Regular
Joined
Oct 14, 2004
Messages
50
How will that work? I do want it to save. I already have code to save it. I want the code to override the message box that pops up when you save a shared workbook.

Caution: You are attempting to save a shared workbook that is also protected with a password. Portions of the file, including the change history, will not be encrypted. To help ensure the security of your file, unshare the workbook or delete the change history from you document. Do you want to save this file?

You then have the option of hitting save or cancel. I want it to save.
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

Code:
Application.DisplayAlerts = False

before the save then set it to True afterwards.
 

QuietRiot

Well-known Member
Joined
May 18, 2007
Messages
1,077
the flase part after activeworkbook.save should do the same thing.

activeworkbook.save false


does that not work for this?
 

Mel L

Board Regular
Joined
Oct 14, 2004
Messages
50
VoG II,
Perfect thanks.

QuietRiot,
I couldn't get it to work.

Thanks for all the help. It is greatly appreciated. :biggrin:
 

Watch MrExcel Video

Forum statistics

Threads
1,123,318
Messages
5,600,921
Members
414,416
Latest member
Nobu

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
Top