Split Workbook VBA w/Default Value for Sensitivity Labels

emacleod

New Member
Joined
Jul 21, 2015
Messages
12
Office Version
  1. 365
I had needed assistance in saving out individual worksheets as separate files from one workbook. The VBA I'm providing below has taken care of this need. However, the organization I work for as recently implemented Sensitivity Labels throughout the Office 365 apps. So, when I run this VBA, I am prompted with the Excel dialog box that requires me to select a value as each worksheet is being created as a workbook. As you can imagine, this slows down the process of running the VBA. I then have to click to select "Confidential" for each time it comes up. I have been unable to locate and add-in additional logic to the existing VBA which would automatically select "Confidential" when the Sensitivity Label is being prompted for entry. So, my ask is the following, please - "Can this existing VBA be revised to account for entering the value of "Confidential" when prompted for the Security Level?" As always, appreciate the assistance! – Thank You!

Here's a link from Microsoft concerning the implementation of Sensitivity Labels - Apply sensitivity labels to your files and email - Microsoft Support

Here is the existing VBA I need to have revised -

Sub SplitEachWorksheet()
Dim FPath As String
FPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each ws In ThisWorkbook.Sheets
ws.Copy
Application.ActiveWorkbook.SaveAs Filename:=FPath & "\" & ws.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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