Export to Excel 2003 with Password

  • Thread starter Thread starter ChoonBoy
  • Start date Start date
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
 
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.
 
Back
Top