Set permission to a folder

Y

Yoav

Hi,
I would like to write a VBA code under Excel 2003 environment that sets
read/write permissions to selected users.
Someone told me to use CACLS FOLDER /E /G USER:F
but I got an 'Expected end of statement' error.
Is this the right solution?
If so, what am I doing wrong?
If not, what is your recommendation?
Thanks!
 
C

Chip Pearson

"Cacls" is a command line program, not part of VBA. Therefore, to call it
from VBA, you need to use the "Shell" function. E.g.,

Shell "Cacls /options"

To get the correct options for your needs, test it out directly from the
command line. Go to the Windows Start menu, choose Run and enter "cmd"
(without the quotes). There, enter "Calcs /?" (without the quotes) to get a
list of all the available options. Once you have the command string correct,
use that string in the Shell function.

In Vista, you should use "ICacls" not "Cacls".


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
Y

Yoav

Hi, Chip
Thanks for your answer.
Since Cacls is not a part of VBA, can you recommend on a command that is
compatible with VBA?
Thanks,
Yoav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top