fitaliano
asked on
Unprotect Excel File from Access
I have an Access DB that transfers data to an Excel file through the following code:
DoCmd.TransferSpreadsheet acExport, 8, "zLOA_List", "C:\WFReports_CG.xls", True, ""
I have recently protected the workbook and when execute the code above I get "could not decrypt the file"
Is there a way to unprotect the file from Access?
DoCmd.TransferSpreadsheet acExport, 8, "zLOA_List", "C:\WFReports_CG.xls", True, ""
I have recently protected the workbook and when execute the code above I get "could not decrypt the file"
Is there a way to unprotect the file from Access?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That would be a great new question.
You can add Excel references to your Access VBA coding. So, when you have an Active worksheet, you can use
The export would use ActiveWorkbook.Protect
Thank you for the grading and accepting my answer.
You can add Excel references to your Access VBA coding. So, when you have an Active worksheet, you can use
ActiveWorkbook.Unprotect Password:="blablabla"
Yes, this would apply when opening an existing workbook.The export would use ActiveWorkbook.Protect
Thank you for the grading and accepting my answer.
ASKER
If I include Microsoft Excel Object Library in my VBE References I could do it, I just don't know how.
The command I want to trigger is:
ActiveWorkbook.Unprotect Password:="blablabla"
How do I specify the workbook to be called?