Export CSV File, set Windows Read-Only attribute

I

InNeedOfHelp!

I need to export a CSV file from an excel sheet with Window Read-Only
attributes (ie. when I right-click on the CSV file from folder view, I need
the Read-Only box checked).

Is there a way to do this with an Excel Marco?

My current code which does not do the functionality described above, is as
follows:
ActiveWorkbook.SaveAs "C:\Test\" + Filenamer, xlCSV, , password, True

Even if this code worked, it is read-only in the EXCEL sense right? I need
to be able to protect the contents even if I open the CSV file with Notepad
or Word.
 
J

Jim Rech

You might check out the VB SetAttr function The file may have to be closed
for this to work.

--
Jim Rech
Excel MVP
|I need to export a CSV file from an excel sheet with Window Read-Only
| attributes (ie. when I right-click on the CSV file from folder view, I
need
| the Read-Only box checked).
|
| Is there a way to do this with an Excel Marco?
|
| My current code which does not do the functionality described above, is as
| follows:
| ActiveWorkbook.SaveAs "C:\Test\" + Filenamer, xlCSV, , password, True
|
| Even if this code worked, it is read-only in the EXCEL sense right? I need
| to be able to protect the contents even if I open the CSV file with
Notepad
| or Word.
 

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