Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2011
    Posts
    23

    Issue with TransferSpeadsheet


    I'm trying to import a spreadsheet which I download from a trusted website using:

    DoCmd.TransferSpreadsheet , , "Sheet1", strPath & "" & strName, False, "A:I"

    The issue I'm having is that if I download the spreadsheet then the import does not include column A, if however I then open and save the spreadsheet the import works OK.

    Both the download and the re-saved file appear to have exactly the same properties, including attributes, with the sole exception that the download size is 84.5K whilst the re-save size is 80.0K

    Both .xls files and Excel 97-2003.

    Any thoughts please?

    Regards

    Terry Lawson

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,936
    I have never experienced the problem but notice you do not complete the optional spreadsheet type - perhaps complete it - here is a link to the different types

    https://msdn.microsoft.com/en-us/vba...eration-access

  3. #3
    Join Date
    Feb 2011
    Posts
    23
    Yup

    Tried adding a variety of spreadsheet types no difference

  4. #4
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    When it's downloaded it will not open for editing correctly the first time without you enabling it as an "safe" trusted internet source.
    I'm not sure you can get around that in VBA? Maybe someone else has?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    docmd.TransferSpreadsheet acExport ,acSpreadsheetTypeExcel12,vQry, vFile, true,vSheetName

    it always works.

  6. #6
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    @Ranman - Terry is importing not exporting.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    Join Date
    Feb 2011
    Posts
    23
    Thanks all

    This may not be the correct forum to post the next question but as very hopeful with you very knowledgeable guys and girls.

    How do I enable a "safe" trusted internet source from either inside or outside Access?

    Back to the OP, I don't think that I mentioned that the spreadsheet when opened from the download is in "Compatibility" mode





Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-08-2015, 02:08 PM
  2. CDate and CStr issue with "Invalid Use of Null" Issue
    By excellenthelp in forum Queries
    Replies: 3
    Last Post: 07-25-2014, 01:34 PM
  3. Replies: 22
    Last Post: 05-21-2013, 07:54 PM
  4. End if issue
    By raytackettsells in forum Programming
    Replies: 4
    Last Post: 03-22-2012, 10:21 AM
  5. Issue with Do
    By Petefured in forum Programming
    Replies: 1
    Last Post: 05-25-2011, 09:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums