A
Andre L via AccessMonster.com
Sometime ago I set up a module to open an Excel Template, refresh the sheets
and save the book to a share. Now I need to stick a password on the file to
be saved. Would anyone know the syntax? Here is the current code:
Dim xcelapp As Object
Set xcelapp = CreateObject("Excel.Application")
xcelapp.Workbooks.Open TemplateBook
xcelapp.DisplayAlerts = False
xcelapp.ActiveWorkbook.RefreshAll
xcelapp.ActiveWorkbook.SaveAs Filename:=NewBook
xcelapp.ActiveWorkbook.Close
and save the book to a share. Now I need to stick a password on the file to
be saved. Would anyone know the syntax? Here is the current code:
Dim xcelapp As Object
Set xcelapp = CreateObject("Excel.Application")
xcelapp.Workbooks.Open TemplateBook
xcelapp.DisplayAlerts = False
xcelapp.ActiveWorkbook.RefreshAll
xcelapp.ActiveWorkbook.SaveAs Filename:=NewBook
xcelapp.ActiveWorkbook.Close