Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jul 2006
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Hanging (2000)

    Hi Hans,

    Am beginning to try to get to grips with VBA, and have the following as part of command for a click button - it works fine, but after its finished the whole application hangs, and I have to close it down and restart it - can you give me any ideas why this might be happening?

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "FarNew", "Cocuments and SettingsMy DocumentsHorizonDataDumpFARNEW.XLS", True
    End Sub

    Thanks!

    Ina

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA Hanging (2000)

    The code itself looks OK. Is FarNEw an existing table or is it created by this code?

  3. #3
    Star Lounger
    Join Date
    Jul 2006
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Hanging (2000)

    It's created by the code.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA Hanging (2000)

    I'm afraid I don't know what causes this. You could experiment by creating a copy of Farnew.xls, removing half of the records and trying to import. If the problem persists, repeat.

  5. #5
    Lounger
    Join Date
    Dec 2004
    Location
    Fort Collins, Colorado, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Hanging (2000)

    the transfer function is not well documented .... but I believe you MUST provide the range parameter "A1:Z1000" or whatever ... to be successful.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA Hanging (2000)

    That is not really necessary. If you omit the Range parameter, Access will try to import the table starting at A1 on the first worksheet in the workbook. You only need to specify Range if you want to import from a range not starting at A1 or on another worksheet than the first one.

  7. #7
    Lounger
    Join Date
    Dec 2004
    Location
    Fort Collins, Colorado, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Hanging (2000)

    That makes sense Hans, but I get in trouble trying to be logical [img]/forums/images/smilies/smile.gif[/img] I posted a similar question regading "exporting" using the same function call ... I'd appreciate it, if you'd look at that. Regards Wayne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •