3709 Runtime Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • repath
    New Member
    • Dec 2009
    • 14

    3709 Runtime Error

    I tried the code with automation:

    For Each sheet In objWorkBook.she ets 'for each sheet in excel loop
    Debug.Print "Imported sheet is :"; sheet.Name
    DoCmd.TransferS preadsheet acImport, acSpreadsheetTy peExcel9, sheet.Name, "OperatorDa ta", True, sheet.Name & "!"
    Next

    the OPERATORDATA excel file has 10 work sheets.
    after importing 6 sheets, this run time error is displayed indicating DOCMD.TransferS preadSheet line

    I tried to import through GetExternalData/Import from Access File Menu.

    this displays an error message without help button on the message box and the message reads like.... SUBSCRIPT OUT OF RANGE.

    Can any one help me please.

    With regards
    Repath.
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    If you are importing columns into specific fields, you should double check to make sure that they match.

    Comment

    • repath
      New Member
      • Dec 2009
      • 14

      #3
      I believe, tables will automatically be created in Access Database when you are importing any sheet from Excel based on the parameters given in the TRANSFERSPREADS HEET function.

      So it is not the case with the table structure.

      I even tried with Import External Data from File Menu in Ms.Access and the error is SUBSCRIPT OUT OF RANGE

      Why does this happen...?

      Any prompt answer will be appreciated.

      Comment

      Working...