DAO Query On Password Protected File: Could Not Decrypt File

Dec 9, 2006

I have an existing application that uses DAO sql queries to populate a form. It has always worked fine. Earlier this week, I password protected the spreadsheet. Now my DAO query fails. I get a run-time error '3161'. Could not decrypt file.

' Const stExtens As String = "Excel 8.0;HDR=Yes;"
Const stExtens As String = "Excel 8.0;HDR=Yes;PWD=money16;"

Private Sub Execute_Query(SQL)
'Instantiate the DAO objects.
strDb = ThisWorkbook.FullName
Set DAO_ws = DBEngine.Workspaces(0)
' code fails on the line below
Set DAO_db = DAO_ws.OpenDatabase(strDb, False, True, stExtens)
Set DAO_rs = DAO_db.OpenRecordset(SQL, dbOpenForwardOnly)
End Sub

View 3 Replies


Macro To See If File Exists Or Password Protected

Nov 29, 2009

I have written a macro to select a range of cells one by one and open the excel files mentioned in them and execute a task. It works fine. But I want the system to see if the file exists in its folder or if the file is password protected (for opening). Either of the case the file should be skipped without a warning message and any attempt to open. I need a macro for that. Following is the way the cell contents are


And following is the VBA code I wrote. It it almost stops when reaching a non-existing file name

View 2 Replies View Related

Unprotect Password Protected File For Other Users

Aug 12, 2013

I have a master file that generates a new file every time the master user run the macro. The macro is pasted here:

Sub NewWorkbook()
ThisWorkbook.Unprotect ("Password01#")


I want the new file to be opening without asking for any password at all. What am I supposed to include in the code for that?

View 9 Replies View Related

Password Protected Excel File - Can Only Open As Read Only

May 31, 2013

I've got a spreadsheet that has password protection before you can "modify" it. All of a sudden today, when I open the spreadsheet and enter the correct password, it still opens but only as Read Only.

View 3 Replies View Related

Web Query For Password Protected Web-sites

Oct 9, 2009

I am trying to import data into Excel from a webpage using the web query function; however, the webpage requires a login and password. I have the required login and password, but I cannot figure out how to make excel automatically input these into the correct fields and login in order to import the data.

Since I am trying to make all of our databases update automatically, I don't want to enter this info everyday when the macro runs.

View 9 Replies View Related

Query File With Largest Number In File Name

Jul 10, 2009

In order to get inventory data from our Incode database, I've been creating an output file with the extension .IRP Thinking that excel would not bring in this data from the .IRP file directly, I would then create a txt file of it with notepad. I've recently discovered that I can bring it in directly from the .IRP

The file being created is in this format:

IN Stock Status Report - 6385.IRP

The number portion, 6385 in the name will vary everytime I generate a new report. However the text portion will not.

Currently, I've recorded a macro the bring in the data to my excel spreadsheet.

But it will only bring in data for the set filename.

View 13 Replies View Related

Password Protection :: Asking For Password Of An Old Deleted File

May 27, 2009

When opening a new Excel file, it is asking me for a password to an old excel file that was password protected, which I have deleted from my computer. It is still asking for this password every time I open a new or existing file. When I hit cancel it lets me open the file.

View 11 Replies View Related

Save A File When Vba Project Is Protected

Feb 8, 2007

I have an Excel File and I have created some code. I locked the VBA Project where that code is contained..... However when I work with the excel executing the mentioned code and after that I try to save it with the information resulting, Excel shows me the following message: "YOU CAN NOT SAVE TO THIS FILE FORMAT WHEN THE VBA PROJECT IS PROTECTED. YOU MAY UNPROTECT THE VBA PROJECT BY CHOOSING THE PROPERTIES COMMAND ON THE VISUAL BASIC EDITOR’S TOOLS MENU, AND ENTERING THE PASSOWORD FOR THE ACTIVE PROJECT....."...

View 4 Replies View Related

Forgotten Password For Password Protected Sheet

Mar 21, 2007

I have a spreadsheet, which has certain worksheets that are password protected. I need to make changes to some of the formulas, and the VBA modules, however I cannot remember the password!! Is there a way of identifying the password??

View 3 Replies View Related

Timestamp Macro When File Has Been Unprotected / Protected?

Mar 6, 2012

I have a file used by numerous facilties. I would like code to track any time a protected sheet has been unprotected / protected. I would also like the stamp to show the user data if that can be done.

View 2 Replies View Related

Protected Sheet - Insert Picture File

Feb 10, 2007

Workbook Password Protect 2 Levels. I have managed to write simple but effective code that allows only one password to be enetered to open a SS & offers 3 levels of protection, limited permission to enter data, read-only & data completely hidden. This is excellent for my needs however I want the user who has limited rw to be able to insert a pic file which is their signature but because the sheet has protected cells it won't allow user to insert picture jpg file.

I have just thought of a creative solution tho. What if the picture file is already saved in the workbook and by using code to ask to insert pic file it copies from one location in SS to the appropriate cell in the worksheets?

The scenario is that I have fortnightly timesheets in 12 calendar months in 12 separate sheets. When staff member fills in timesheet I want them to insert signature for that f/night indicating thatthey have filled it in & it is correct but because of protection it won't allow me to.

View 2 Replies View Related

How To Put Password For Excel File?

Feb 16, 2010

I searched the forumn but didn't find thread sorry for creating new thread.

frends i have 2 questions.

1) How to put password for excel file (2003) ? (not for sheet)

2) How to remove password from excel file ? (if its not break forum rule).

View 3 Replies View Related

2 Password For One Excel File

Apr 17, 2014

Is it possible for Excel file to be open with 2 password? Like, if password is equal to "Password1" the file can be edited but if password is equal to "Password2" the file will be open as read only, if so, VBA code.

View 1 Replies View Related

VB- Open File With KNOWN Password

Oct 22, 2009

I have a macro that opens Spreadsheet_A, copies the contents to Spreadsheet_Master, closes Spreadsheet_A, then repeats the process for Spreadsheet_B then ss_C then ss_D etc etc etc.....

Each spreadsheet is password protected, and the password is the same for all spreadsheet to stop casual browsing only. I have set the password.

When I run the macro, I have to type the password in each instance, ie 20 or more times for 2 or more files.

Anyone know the code to insert so the spreadsheet opens without my typing the password.

[It's Excel 2007, but I presume the same code as Excel 2003]

View 9 Replies View Related

Save File Only Through Password

Aug 2, 2007

I tried to research this as much as I could, the thread below is a start but doesnt appear to be close...my request is a bit of a variant to this. I essentially need code that prevents someone from saving the file unless they have the right password.

View 6 Replies View Related

Can't Edit File That Opens In Protected View Mode

Apr 12, 2013

A client has sent me an Excel workbook that appears on the screen with the message adivising that it is Protected View as a result of having been downloaded from the internet. If I click on the Enable Editing button the workbook is completely deactivated. I have played around with my Trust Centre settings but nothing seems to work.

View 1 Replies View Related

Getting Data From MDB File Protected With User Level Permissions?

Aug 30, 2013

I need to get the data from an MDB file. No problems normally but in this case the MDB is protected with a workgroup file (MDW) from the old user level permissions that was available in Access.

Is it it possible to get data from the Data ribbon from a protected file or do I need to resort to vba?

View 1 Replies View Related

Unable To Open XLS File Without Password?

Feb 5, 2013

I have a certain .xls file which is password protected.

Now i have forgot the password for opening the file. Is there any other way of opening the file without password or using a Macro.

View 2 Replies View Related

Removing A Password From A Corrupt File?

Sep 30, 2013

Is there anyway I can remove the password from a corrupt file that I cant access so that I can use Stellar Pheonix Excel Recovery to repair it?

View 8 Replies View Related

VBA To Open File And Enter Password

Jun 24, 2014

I have the following line of code to open a file and enter the password to allow modifications.

When I run the code the file opens but then the password isn't entered.

View 2 Replies View Related

Function Call To Set The Password Of The File

Apr 23, 2007

I found a function to set the password a an excel file:

Function SetPwd(strNoPwdFile As String, _
strPwdFile As String, _
Optional strOpenPwd As String, _
Optional strModPwd As String) ' As Boolean
' This function requires the following arguments:
' strNoPwdFile - The path to a document without a password.
' strPwdFile - The path and name to save the password-
' protected document.
But the compiler said that it is syntax error.

How can i rectify the error?

View 9 Replies View Related

Query File Names In Folder

May 28, 2009

Is there a way to write somethign that will go to a particular folder on your computer and bring back the Names of all files in that folder?

I need to build a sheet that lists certain information from each file, which is already included in the file name - trying to avoid opening hundreds of files just to get data from one cell....for example:

All files are in the following folder: ....

View 11 Replies View Related

Open Large Txt File With Query

Sep 20, 2006

I have a large text file (greater than 64k lines) which I need to import into excel. I only need anything imported from the text file that is for dates I specify. So I would like to run a line by line query and only import the lines I need.

The dates are always in position 43-50 (dd-mm-yy) in the text file itself, so the code would have to look at that section, see if the date is within the range specified and only import if it is (and then move onto the next line).

View 4 Replies View Related

Password Protect File With Read Only Button?

Jul 12, 2012

My boss has come to me and asked how does she get her file to go back to the way it was before, she had a password on the file but you used to be able to click on a button that said "Read only" this button no longer appears and i am unable to get it back. I still get the password box pop up but it is smaller and does not contain the read only button.

View 3 Replies View Related

How To Review Who Has Opened A File With Password And Made Changes

Apr 17, 2013

I have a master file which users are able to open via read only or go in via password to edit.

I'm not too bothered on the read only users more on person's entering the file via password, making any changes and then saving those changes.

Is there a way to trace what changes they made and would their name be saved as the new "author" of the file?

View 4 Replies View Related

Storing Username And Password Data In .txt File

Aug 20, 2008

I was able to get some help a while ago and hoping for someone to reply as well. Any one have ideas how to create a userform which will be use for username and password input? I know how to create one but is there anyway that the username and password will be stored as .txt file instead of using worksheet to store the data?

View 14 Replies View Related

File Prompts To Unprotect Sheet With Password

May 8, 2009

In wrote a workbook in Excel 2003 that is causing me a problem I can not seem to figure out. The workbook consists of multiple worksheets that work using both VBA code or cell formulas. The worksheets are protected (though w/o a password) to prevent users from accidently altering a cell formula. When the code needs to write to a cell, it first unprotects the sheet, writes to the cell(s), and then reprotects the sheet.

Everything seems to work fine, often for several months. Then somehow something goes wrong. Specifically, after double-clicking on the ListBox in the worksheet “CRI Calculator” to pick a drug name, it will improperly present a dialog box (see attached screen capture 'Unprotect Sheet DialogBox.JPG') prompting the user for a password to unprotect the worksheet. Again, no password has ever been set; I have tried entering nothing, “password”, and "anonymous". Regardless of how you respond, an error code “Run-time error ‘1004’: The password you supplied is not correct…” occurs. If I press Debug, it takes me (ironically) to the following line of code

View 11 Replies View Related

Generate Password Base On File Name In Directory

Aug 1, 2006

1. In centain directory I have xls files where name of each file starts from "HR" string, eg. "HG_Control Mike.xls", ora "HR_Control Mark.xls".
2. I have a master xls file where I want to start a macro that will open each of xls "HR" files and copy selected rows to this master xls workbook (need to write this one too).

Problem is that opening of every "HR" files suposed to be protected by password. Users will be adding new xls "HR" files to the directory so I will not be able to change macro everytime new xls is added. So, I need to make a macro that will generate password base on xls "HR" file name and then I will use this password to protect this files and open them by another macro.

View 9 Replies View Related

Prompte Plugin Password When Open File

Aug 17, 2006

When I opened up the excel file, it prompted me to plugin password. There is no read-only option too. how can i open it up, i tried download some password
protector software to crack it, it is only limited demo which mean can open that file partially not full indeed

View 3 Replies View Related

Open Large Text File With Query?

Sep 20, 2006

I have a large text file (greater than 64k lines) which I need to import into excel. I only need anything imported from the text file that is for dates I specify. So I would like to run a line by line query and only import the lines I need.

The dates are always in position 43-50 (dd-mm-yy) in the text file itself, so the code would have to look at that section, see if the date is within the range specified and only import if it is (and then move onto the next line).

View 5 Replies View Related

Copyrights 2005-15 www.BigResource.com, All rights reserved