Excel Automation

graveyard

New Member
Joined
Jul 12, 2011
Messages
35
Hi people. may i know how do i use common object model (automation) to set password programmatically for excel files without opening them? I am dealing with 50 files so its too much to open every one and set password manually. And i cant use the same file over and over again as these files were exported automatically to excel spreadsheets which means each file will be overwritten from time to time

as such i cant have macro embedded in the file as those will be overwritten too. Was wondering if there is a way to set different password to each file which will be put on a FTP server (as these will contain sensitive data, password is imperative to prevent unauthorised access).

Appreciate if someone could shed some light - thanks!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Welcome to the board.

I don't know about adding a password without opening the file, but you could open it in the background and resave it with a password added.

PS I'm assuming the password would be the same in each case, although that wouldn't necessarily make it impossible if they were different, just harder to manage.
 
Upvote 0
Welcome to the board.

I don't know about adding a password without opening the file, but you could open it in the background and resave it with a password added.

PS I'm assuming the password would be the same in each case, although that wouldn't necessarily make it impossible if they were different, just harder to manage.


hi weaver, thank you. its nice joining the board here. ive w workaround for this by exporting the excel files via macro to folders with restricted access on a shared drive.

Thanks for your reply!!
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,711
Members
452,939
Latest member
WCrawford

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