Can Access export to Excel as a read-only file?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to export query results from a database using a Visual Basic module to
an MS Excel spreadsheet, and have that spreadsheet 'read-only'. Is this
possible?

Thanks,

RD
 
Hi Ron,

You can't create a read-only workbook, but you can create it and then
make it read-only. There are various options depending on what you
envisage by "read-only":

This
SetAttr <filespec>, vbReadOnly
sets the Read-Only file attribute.

Or you could write code that opens the file in Excel and either

(a) does SaveAs with ReadOnlyRecommended:=True
or
(b) locks and protects cells, worksheets and structure as required

Or you can get into the Windows permissions for the file to control just
who can do what to it.

On Thu, 27 Apr 2006 12:28:02 -0700, Ron D <Ron
 
Back
Top