SnowBall
07-18-2007, 01:13 PM
I am using the do.cmd outputTo command. Does anyone know of a way to make the output file read only?
DoCmd.OutputTo acOutputQuery, strquery, acFormatXLS, filepath, True
Dom DXecutioner
07-18-2007, 03:25 PM
Hi,
If i read this correctly, you're exporting a query into an excel file, is this correct?
If so, there's no way to do that because, obviously, is in excel. You could; however, create a basic report and output it as a snapshot and this will solve your problem.
petehilljnr
07-18-2007, 04:24 PM
Or - you could use another method whereby you create a spreadsheet (using the Excel object), populate the spreadsheet and then lock all of its cells and protect the workbook - all through VBA ?
Dom DXecutioner
07-18-2007, 05:51 PM
Excellent suggestion :D
I'm curious... is this being exported for viewing only or as an attachment file? If it's only for displaying purposes, why not show the data in an access datasheet form? The recordset type can be snapshot and thereby uneditable.