[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Unprotect Excel File from Access

Posted on 2011-09-30
3
Medium Priority
?
305 Views
Last Modified: 2012-06-21
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?
0
Comment
Question by:fitaliano
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
Richard Daneke earned 2000 total points
ID: 36893989
I have good news and bad news.
The good news is that no password is needed with the DoCmd. TransferSpreadSheet
The bad news is that your password is preventing the computer from replacing your existing file.  So, you must leave the workbook unprotected.
If security is an issue, place the file in a folder with restricted permisssions.  Remember, whoever uses Access to create this exported spreadsheet will need create, read/write access to the folder.
0
 

Author Comment

by:fitaliano
ID: 36894130
I was actually thinking of calling Excel objects and unprotect the file from Access.

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?

0
 
LVL 19

Expert Comment

by:Richard Daneke
ID: 36894976
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
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.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question