Unlock the Macro file every time using the file property

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
883
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team,

Do we have any other option? to unlock at once instead of unlocking every Macro file we are getting from different system.

1710359406337.png
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I am afraid not (I am not sure). BUT...
You can use tiny powershell script like below:

VBA Code:
#[String]$curDir = Split-Path $MyInvocation.MyCommand.Path -Parent
#[String]$curDir = $ENV:TEMP
[String]$curDir =  "\MyMagicFolderWhereIHaveDownloaded XLFiles to unlock"
Get-Childitem -Path ($curDir + "\*.xls*") -Recurse -File | % { $_.IsReadOnly=$false }
Get-ChildItem -Path $curDir -Recurse | Where-Object{ $_.Extension -in '.xlsm', '.xls'} | Unblock-File

put this into MyUnlocker.ps1 file and everytime when you got any new file and know that have to be unlock run this file.
 
Upvote 0
I am afraid not (I am not sure). BUT...
You can use tiny powershell script like below:

VBA Code:
#[String]$curDir = Split-Path $MyInvocation.MyCommand.Path -Parent
#[String]$curDir = $ENV:TEMP
[String]$curDir =  "\MyMagicFolderWhereIHaveDownloaded XLFiles to unlock"
Get-Childitem -Path ($curDir + "\*.xls*") -Recurse -File | % { $_.IsReadOnly=$false }
Get-ChildItem -Path $curDir -Recurse | Where-Object{ $_.Extension -in '.xlsm', '.xls'} | Unblock-File

put this into MyUnlocker.ps1 file and everytime when you got any new file and know that have to be unlock run this file.
sure! I will try this and let you know if we have any questions.

Wanted to check do we have any other option apart from the above things like going to File Menu>Option>Trust Center>>Any option?
Thank you:)
 
Upvote 0

Forum statistics

Threads
1,215,205
Messages
6,123,632
Members
449,109
Latest member
Sebas8956

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