Export to Excel 2003 with Password

C

ChoonBoy

I am trying to export a query to Excel 2003 using codes.

I want the resultant file to be attached with a trailing date eg.
FileName_2009-08-17.xls . I also want it to to be password protected eg.
PW123.

Appreciate any help, thanks
 
D

Douglas J. Steele

The file name part is easy: use something like:

strFile = "C:\Folder\Filename_" & Format(Date, "yyyy\-mm\-dd & ".xls"

then include strFile in the TransferSpreadsheet method.

Access cannot create a password-protected workbook, though. You'd have to
use Automation in have Excel set the password once you've created the
workbook.
 

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