Opening A Password Protected Excel File From A Command Button In Access

Dec 22, 2006

Hi All,
I have three excel files (ActualHires.xls, ActualPromotions.xls and
ActualSeparation.xls). These are password protected files (with the
same password). They are linked to an access database and whenever the
files are opened, one must supply the password and click the 'Enable
automatic refresh button.' What I was wondering was if this could be
done in access with a command button. I have pasted some code below
that I found but now I'm getting an error.
This is the code:

Dim BookNames As Variant
Dim B As Long


BookNames = Array("O:ExcelFilesActualHires.xls",
"O:ExcelFilesActualPromotions.xls",
"O:ExcelFilesActualSeparations.xls")


For B = LBound(BookNames) To UBound(BookNames)
WorkBooks.Open FileName:=BookNames(B), _
UpdateLinks:=3, Password:="*******"
WorkBooks(B).Close SaveChanges:=False
Next B


But when I click the button, I get this error:
Run-time error '9' Subscript out of range.


and this line is highlighted:
WorkBooks(B).Close SaveChanges:=False


Any help would be greatly appreciated.


Thanks.

View Replies


ADVERTISEMENT

Modules & VBA :: Detecting Excel File Is Password Protected

Apr 4, 2014

Any VBA code that would tell me whether an xlsb file is password protected?

View 5 Replies View Related

Password Protected Button

Feb 13, 2005

Hi,

this is me again and I need your help!

How can I add a password to a button, i.e. whenever someone clicked on this button he has to enter a password in order to proceed to the form which the button opens?

any help will be very much appreciated!

Thanks and Regards!
CS.

View 5 Replies View Related

General :: Opening Excel With A Command Button?

Jul 12, 2013

I am trying to open MX Excel using a command button. I have tried using a hyperlink a various codes that i have found online with no luck. The Excel file is being used by the Access as it bring data from the spreadsheet a displays it within a subform. (I think this is where the problem occurs) The subform displaying some data from Excel is working fine but when i click my hyperlinked button i am met with errors and the file will not open.

View 6 Replies View Related

Forms :: Opening PDF File From Button Command

Aug 19, 2015

I would like to open a PDF document using a button control on a form to a file path listed in a field on the form (Me.Link). I am trying to use the followHyperlink code but I keep getting the runtime 490 error.

This is the code im using:

Dim strFilePath As String
strFilePath = Me.Link
Application.FollowHyperlink (strFilePath)

If I put a filepath to one of the pdf documents in the place of (strFilePath) it opens that pdf document fine but not when I declare a filepath based on the one listed on the form.

View 8 Replies View Related

Relink Backend File Using VBA With Password Protected File

Nov 5, 2013

I have a code to relink a 2 backend files at start up. The problem is one of the files is password encrypted.

Code to input the password?

Dim dbsTemp As Database
Dim strMenu As String
Dim strInput As String
' Open a Microsoft Jet database to which you will link
' a table.
Set dbsTemp = CurrentDb

[Code] .....

This part is calling the password protected database

Code:
ConnectOutput dbsTemp, _
"Usernames", _
";DATABASE=C:UsersquicoDesktopWeight_estimate_software_Usernames.accdb", _
"Usernames"

View 2 Replies View Related

Open And Excel File W/ Command Button?

Nov 3, 2006

I am trying to open a workbook with a command button on a form however the path to the file is giving me a fit. The path for the file location contains spaces and I am going blind trying to figure out how to rectify the path. Heres the line. I am sure someone here will see this problem quick! Thanks.

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim stAppName As String

stAppName = "Excel.exe N:OPSCOMMONOpsResearchContact CenterDI CCL Reporting dBApps by Agent.xls"
Call Shell(stAppName, 1)

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub

Heres the mess I made out of it:
stAppName = "Excel.exe N:OPSCOMMONOpsResearchContact" & Chr(32) & "CenterDI" & Chr(32) & "CCL" & Chr(32) & "Reporting" & Chr(32) & "dBApps" & Chr(32) & "by" & Chr(32) & "Agent.xls"""

:confused:

View 6 Replies View Related

Command Button To Open Excel File

Nov 15, 2006

Is this possible? A command button when click will open an excel file... :rolleyes:

Cheers!
Sheila

View 5 Replies View Related

Command Button To View PDF / Excel File Or JPEG From Object Within Database Table

Aug 12, 2013

I have created a database for a church cemetery. It contains the usual names, birthrates deaths, etc.... I have also created a map of the cemetery in PDF format with the lot number highlighted which is assigned to a particular record. I did the same in excel with a layout of the lot and a JPEG picture of the grave marker. In my table I created Three columns - Site Plan, Lot Plan, and Grave marker. I insert the specific site plan, lot plan, and jpeg picture using the "insert object" in the table. On my form after a search, I have created three buttons.. Site Plan, Lot Plan & Grave Marker.

I have looked and experimented trying to assign these command buttons to open these files on the form. I don't have any experience with macros or VB code.

View 4 Replies View Related

Open Password Protected Access 2007 Db In ASP

Feb 11, 2008

Hi, I have been opening password protected access 2003 databases with ASP / ADO for years now. However now we have updated to office 2007 everything gone bottoms up.

I have an access 2007 database (newly made, not converted from 2003), and a fresh asp page. I've gotten the new connection string information for Access 2007 from the internet yet the page cannot open the database.

connection string being used:

sConnString="Provider=Microsoft.ace.OLEDB.12.0;Data Source=" & strPath & ";Jet OLEDB:Database PASSWORD= password"

When I try to open the page the error i get is - "Not a valid password" - 80040e4d. I'm 100% sure the password is correct, the driver is right (the server has office 2007 installed, and the new access driver from the M$ website). Every page i've seen on the internet says that the code I'm using is correct, yet asp still can't open it.

If i remove the password from the database it opens fine, so it's not a corrupt database, or bad path in the code.

If you can shed any light on my problem I would be eternally grateful - been working on it for hours now!

Many thanks
Ryan

View 10 Replies View Related

Batch Process To Open Password Protected Access Db

Jan 30, 2008

Hi All

I need to schedule the opening of a MS Access database which is password protected.

I think the best way to do this would be to use schedule a batch process to run, can anyone help with the script to create a batch proccess to only OPEN and CLOSE an MS Access database?

Thanks

View 1 Replies View Related

Opening An Excel File In Access 97

Aug 26, 2005

I created an Excel file using:

DoCmd.OutputTo acOutputQuery, _
"Compile_Query", acFormatXLS, _
"G:ServiceCompanySanDiegoWarehouseLCDLine_Summa riesDaily" _
& DateMonth & DateDay & DateYear & ".XLS", False

However, after creating this excel file, i want it to automatically open.

Is there any way to do this in 97?

View 1 Replies View Related

Modules & VBA :: Opening Excel File From Access Form

Sep 21, 2014

I am trying to program a button on my ms access form to open up an excel file.. So far the simplest code ive found online was from URL....

<code>

Private Sub Command57_Click()
Dim xlTmp As Excel.Application
Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open "C:Excel1.xls"
xlTmp.Visible = True

[code]...

However the code doesn't work, any way to open a file from within access?

View 1 Replies View Related

Access 2010 - Delete Form Command Button With A Password To Confirm Delete

May 6, 2014

All I am trying to do is insert to have a form with a "Delete Record" button on it. The problem is I don't want anyone to be able to delete a record, I would like someone to have to insert a password to confirm the delete.

View 13 Replies View Related

Password Issues With Non Protected Database Asking For Password

Nov 8, 2005

Hi,

Firstly thank you for your help, this should be a simple one I hope, but is cracking my head on the wall. Have searched and searched and can't find an answer.

I have an Access Db that is not password protected, but is asking for a password.
It opens on any other machine fine?

I think my version of Access is playing funny buggers with me, any suggestions?

I was trying to implement some security on this Db, which is why it happened I'm sure. I ran the security wizard, set-up two users and admin with passwords, I have the output file to "recreate" something too.

Issue is, I then copied this Db to another computer for use on there, it worked without a Password, so didn't need to worry about it, now I can't open any Db on my machine??

Your help on this obvious pointer would be great!

C

View 3 Replies View Related

Password On A Command Button?

Feb 11, 2004

Hi, i have a slight problem that i could really do with some help on.
I have a form in which u can edit/add or delete details of a record. What i would like to do is when someone presse's the delete button i would like a box to pop up asking for a password to be entered before the record is deleted just to prevent certain records from being deleted.

Thanks,

Ben

View 6 Replies View Related

Password On Command Button

Aug 2, 2006

On a "delete record" command button I want to put a password prompt so when you press it, it will only allow you to delete the record if a password is entered.

How?

View 3 Replies View Related

Modules & VBA :: Determine Excel File Type Without Opening The File?

Aug 14, 2015

Question: Is it possible, using VBA, to determine the actual Excel file type without opening the file?

I receive data files from other departments. Seems like every time someone changes their download structure, I end up with file types that do not match the download extension (example: xlm file with a xls extension). The files can't even be opened because of this. I think I can fix it if I could figure out how to determine what the file type really is.

I'm using Office 2010.

View 3 Replies View Related

Opening Specific Invoice From Command Button?

Jul 20, 2014

I am trying to create a command button that sits on the order details page and that will open up a report i have created called 'picklist' which is basically the same as an invoice but with some different product information listed on it.

I want the command button to open up the picklist that corresponds to the order that i am on e.g picklist #2 for invoice#2

1) I have seen this code on the internet -

DoCmd.OpenForm "SecondFormName", , , "FieldName = #" & Me.ControlName & "#"

Would this work for me if i was to modidy it to:

DoCmd.OpenForm "PickList", , , "InvoiceID = #" & Me.[txtID] & "#"

2) Where do i input this code? If i click on the 'onclick' in the properties form im presented with this page (attachment):

View 6 Replies View Related

Password Protected Form

Aug 17, 2006

Hi all

I want to use a password for just a form and a report not all the database
if any one have example please help

Baig

View 1 Replies View Related

Password Protected Form

Nov 8, 2006

Hello All,

I have found the following code to password protect my form, it works but I have one problem, the input txt box does not have the input mask set so the password can be seen on screen, here is the code I have:

Private Sub Maintenance_Button_Click()
Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered open Employees form
'If incorrect password entered give message and exit sub

If strPasswd = "ssd" Then
DoCmd.OpenForm "Maintenance", acNormal
DoCmd.Close acForm, "Menu", acSaveNo
Else
MsgBox "Sorry, you do not have access to this form", _
vbOKOnly, "Important Information"
Exit Sub
End If


End Sub


Can anyone advise on what vba cmd to use in the password string to enable the password input mask?

Regards

View 2 Replies View Related

General :: Opening Specific Invoice From Command Button

Jul 20, 2014

How to modify an existing database template to meet my needs.

I am trying to create a command button that sits on the order details page and that will open up a report i have created called 'picklist' which is basically the same as an invoice but with some different product information listed on it.

I want the command button to open up the picklist that corresponds to the order that i am on e.g picklist #2 for invoice#2

I have 2 issues/questions:

1) I have seen this code on the internet -

DoCmd.OpenForm "SecondFormName", , , "FieldName = #" & Me.ControlName & "#"

Would this work for me if i was to modidy it to:

DoCmd.OpenForm "PickList", , , "InvoiceID = #" & Me.[txtID] & "#"

2) Where do i input this code? If i click on the 'onclick' in the properties form I am presented with this page (attachment):

View 8 Replies View Related

Help Needed With Password Protected Buttons

Apr 12, 2006

Hi, I have a button on form A that opens form B, but i wud like to put a password on this button, so when you click it, you have to type in a password before form B opens.
I'm using access 2000.

Cheers
Alex

View 1 Replies View Related

Moving Password Protected Database

Dec 28, 2006

Hi Everyone,
I am attempting to move a password protected database to a different folder on our shared drive but I am not sure the steps that are needed to do so. The database is already split. Can someone please assist???

View 3 Replies View Related

Open A Password Protected Database

Jun 22, 2007

Hi,
I'm trying to convert a access database in to a sql server. My client hasn't got the exclusive access or doesn't have a username password for the access database. I'm trying to import the data in the access to sql server and when I try to open it it says
"
This error is usually associated with opening or converting a security enhanced Access 97 or earlier database. If you are not the owner of the database, you most likely will not have the necessary access rights to open or convert it.
"

Is there a way around this.

Cheers,
-Vije

View 2 Replies View Related

Back-end Db Password Protected FE Probs

Apr 2, 2008

Hi guys!
I have a front-end (FE) linked to a back-end (BE) db.
I have added a password to the BE, but the knock on effect is that the FE won't work now. Just says 'Invalid Password'.
I'm using MS Access 2002.

Any help would be appreciatted.

(The password is to prevent unwanted users from deleting data on the BE on the server)

View 1 Replies View Related







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