+ Reply to Thread
Results 1 to 5 of 5

ADODB Connection string for Excel files located on OneDrive

  1. #1
    Registered User
    Join Date
    12-13-2018
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    7

    ADODB Connection string for Excel files located on OneDrive

    Hi,

    I have a process where I use an ADODB connection to retrieve record data from an excel file:
    Please Login or Register  to view this content.
    This all works perfectly well provided the Excel file (or strDataFileNamePassed) is a folder location on my local PC or mapped network drive. However, if I move the Excel file to OneDrive then when the code runs to the the line: .Open strConnection there is a long delay where nothing happens and after about 45 seconds I get:

    Error -2147467259 The Microsoft Access database engine could not open or write to the file (file name). It is already opened exclusively by another user or you need permission to open and write to the file.

    The file certainly isn't opened. Does anyone know how to resolve this issue.

    Thank you.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,259

    Re: ADODB Connection string for Excel files located on OneDrive

    Try to implement such a fragment into your code:
    Please Login or Register  to view this content.
    Probably, instead of OneDriveCommercial you can also use OneDrive.

    Artik

  3. #3
    Registered User
    Join Date
    12-13-2018
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: ADODB Connection string for Excel files located on OneDrive

    No, your line with VBA.Environs("OneDrive") throws and error. The actual path passed is:

    "XXXXX:**d.docs.live.net*b0009d54416167de*Desktop\This is a test.xlsx" (where XXXXX is https and * is a forward slash)

    What path should I try to be creating? Thank you.

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,259

    Re: ADODB Connection string for Excel files located on OneDrive

    Does VBA.Environ$("OneDriveCommercial") return the same path?

    Artik

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,259

    Re: ADODB Connection string for Excel files located on OneDrive

    BTW. Not VBA.Environs("OneDrive") but VBA.Environ$("OneDrive").

    Artik

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ADO Connection Not Working on Files Located on Cloud Storage Provides
    By masouder in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2023, 06:15 AM
  2. MS Access ADODB Connection String - Invalid File Path, Does not Exist
    By ironfelix717 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2018, 08:01 AM
  3. [SOLVED] ADODB.Connection Generating Error on File Located on Cloud
    By masouder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2017, 03:42 PM
  4. excel ADODB.connection to itself ? how?
    By djorkaef in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2010, 11:28 AM
  5. ADODB Connection String
    By iancallaghan87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-30-2008, 11:54 AM
  6. [SOLVED] ADODB Connection String
    By Nigel C in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2005, 03:05 AM
  7. connection string to connect to Excel using ADODB
    By Naresh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2005, 12:28 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1