Advertisement

07.23.2008 at 10:29AM PDT, ID: 23589405
[x]
Attachment Details

Ammending to a table from multiple excel spreadsheets

Asked by jsheeh9427 in Microsoft Office Suite, Microsoft Access Database, Microsoft Excel Spreadsheet Software

Tags: Microsoft, Access 2003 / Excel 2003, 2003

I have a database that is workign great right now.  I can choose the excel spreadsheets I need to import and it imports them.  However, I would like to be able to ammend to the current table.
below is the code I am using.  How do I tell it to ammend to the table vice trying to rewrite the table everytime I run it?
Thanks
JSStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
Private Sub test_Click()
 
Dim objXL As Object
Dim sTable As String
Dim xlPath As String
Dim i As Integer
Dim dDate As Date
Dim shtName As String
Dim strFilter As String
Dim strInputFileName As String
 
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
                Filter:=strFilter, OpenFile:=True, _
                DialogTitle:="Please select an input file...", _
                Flags:=ahtOFN_HIDEREADONLY)
 
xlPath = strInputFileName
 
Set objXL = CreateObject("Excel.Application")
    objXL.Workbooks.Open xlPath, , True
    With objXL
        For i = 1 To .Worksheets.Count
            DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "CSMP Upline", xlPath, True, .Worksheets(i).Name & "!"
         Next
    End With
    objXL.Quit
    Set objXL = Nothing
 
End Sub
 
Loading Advertisement...
 
[+][-]07.23.2008 at 10:32AM PDT, ID: 22071711

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.

 
[+][-]07.23.2008 at 10:41AM PDT, ID: 22071812

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.

 
[+][-]07.23.2008 at 10:47AM PDT, ID: 22071863

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: Microsoft Office Suite, Microsoft Access Database, Microsoft Excel Spreadsheet Software
Tags: Microsoft, Access 2003 / Excel 2003, 2003
Sign Up Now!
Solution Provided By: capricorn1
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628