Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Password Using Access
I am try to add a password to an exported spreadsheet programmatically using
MS Access. I borrowed this code from another program and it works perpectly except, it requires the user to enter YES to save the document. How can I modify this code to prevent having to answer Yes to the save changes question. Code: strCompleteExcelName = DestinationFolder & ExcelFileName Set app = New Excel.Application Set wbk = app.Workbooks.Open(FileName:=strCompleteExcelName) With wbk .SaveAs FileName:=DestinationFolder & ExcelFileName & ".xls", _ WriteResPassword:=ReadOnlyPassword .Close End With Set wbk = Nothing ' Shut down the Excel connection. app.Quit Set app = Nothing Thank you Ross |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Password Using Access
Try perhaps
..close false Wolf "Ross" wrote: I am try to add a password to an exported spreadsheet programmatically using MS Access. I borrowed this code from another program and it works perpectly except, it requires the user to enter YES to save the document. How can I modify this code to prevent having to answer Yes to the save changes question. Code: strCompleteExcelName = DestinationFolder & ExcelFileName Set app = New Excel.Application Set wbk = app.Workbooks.Open(FileName:=strCompleteExcelName) With wbk .SaveAs FileName:=DestinationFolder & ExcelFileName & ".xls", _ WriteResPassword:=ReadOnlyPassword .Close End With Set wbk = Nothing ' Shut down the Excel connection. app.Quit Set app = Nothing Thank you Ross |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Password protection/access | Excel Discussion (Misc queries) | |||
access password to worksheet | Excel Worksheet Functions | |||
access password | Excel Programming | |||
Password to get access to certain sheet | Excel Programming | |||
Password to access a worksheet | Excel Programming |