Advertisement

05.08.2008 at 08:06AM PDT, ID: 23386336
[x]
Attachment Details

Import an Excel Password Protected Worksheet into Access using VBA

Asked by c9k9h in Access Coding/Macros, Microsoft Access Database, SQL Query Syntax

There are many threads on this, but after spending over 1/2 hour trying to find something that works - I need to move on.

I 'm attaching the code snippet that I'm using (on a command button).

However, I just found out that the original file comes in password protected.  I have the password and I don't mind hardcoding it (it will never change); and I don't mind removing it if that's easier.  I saw examples of both types of scenarios throughout the threads - but I need one that I can get to work.  I would like to use some as simple as possible and keep it on the command button if possible.

Also, I realized after doing some testing that this code appears to be appending records.  I need it to overwrite the existing table each month.
Thank you!
Start Free Trial
1:
2:
3:
Private Sub cmdImportTerms_Click()
    DoCmd.TransferSpreadsheet , acSpreadsheetTypeExcel8, "Terminations", "C:\Documents and Settings\c9k9h\My Documents\NorthsideTerms.xls", True
End Sub
 
 
[+][-]05.08.2008 at 08:36AM PDT, ID: 21525643

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database, SQL Query Syntax
Sign Up Now!
Solution Provided By: matthewspatrick
Participating Experts: 2
Solution Grade: B
 
 
[+][-]05.08.2008 at 09:10AM PDT, ID: 21525988

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.08.2008 at 09:37AM PDT, ID: 21526278

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.08.2008 at 10:54AM PDT, ID: 21526932

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2008 at 11:43AM PDT, ID: 21527335

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 11:30AM PDT, ID: 21557866

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628