Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TransferSpreadSheet Function

Status
Not open for further replies.

vza

Programmer
Aug 1, 2003
179
US
I have an VB app which transfers converted Excel spreadsheets to a format acceptable foe insertion into a Access database. I use the TransferSpreadshet Function to transfer the spreadsheet (once it has been altered) into the DB. Everything worked fine when inserted into a test (temporary) table. But we I tried to add the data to my existing table (over thousands of entries) the line of code executes but nothing is transferred into the table...I am confused...Help specifically states that this function can be used to append data to an existing table...

Here is my code:
Code:
  ' ***Transfer***
        xlstr = ConvertForm.ExcelText.Text
        Range = GetUsedRange(xlstr, "Sheet1")

    ' Create Access Appilcation Object
        Set axApp = CreateObject("Access.Application")

    ' Open Access Database
        axApp.OpenCurrentDatabase ConvertForm.AccessText.Text

    ' Transfer Excel Spreadsheet to Access Database
        axApp.DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "FollowSheetInfo", ConvertForm.ExcelText.Text, True, Range

    ' Quit Access Application
        axApp.Quit
        Set axApp = Nothing

Thanks,
-vza
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top