Consulting

Results 1 to 7 of 7

Thread: UrlDownloadToFile API in VBA MS ACCESS not working with SharePoint ONLINE (cloud)

  1. #1
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location

    UrlDownloadToFile API in VBA MS ACCESS not working with SharePoint ONLINE (cloud)

    Been using API URLDownloadToFile for many years to download files from a SharePoint website, but we recently went to SharePoint ONLINE (on the CLOUD not exactly the same as the old SharePoint server method) and it stopped working KIND OF. It still returns 0 (File downloaded OK), and a file is downloaded, but only a tiny part of the file is download; always 4kb in size for the pdf file we're testing with. The pdf file is about 10mg in size. Then Adobe DC gets a "cannot open file because it's not formatted correctly".

    Note, if we open up IE and go to the SharePoint ONLINE site, then classic view, then select OPEN with FILE EXPLORER it "does something in the background" and the very same code and API URLDownloadToFile WORKS with NO CHANGES. A complete (10mg size) file is downloaded and works perfectly.

    What VBA steps do I have to use before calling the URLDownloadToFile API to duplicate what the FILE EXPLORER is doing mysteriously in the background? It's just a file (not a SharePoint LIST) that we want to download from SharePoint ONLINE site and save automatically into a specific folder on the local laptop, then run word, excel, adobe dc to automatically open the downloaded file based on its file extension .doc, xlm, .pdf, etc.

    Thanks so much in advance.

  2. #2
    VBAX Regular
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    37
    Location

  3. #3
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location
    Is that a problem?

  4. #4
    VBAX Regular
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    37
    Location
    Not per se, as long as you mention the other posts.?
    Otherwise you will likely get the same information from each post, and will just be wasting volunteer's time, repeating what has already been said,

    It is considered good manners to mention that you have posted elsewhere, with a link to that post, so people can see what has already been offered?, and can then perhaps offer something that has not been suggested yet.

    The crosspost post is to advise members that there are possible responses elsewhere.
    Last edited by Gasman; 07-09-2022 at 12:32 AM.

  5. #5
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location
    40 years in IT and many forums, but I’ve never heard this. I will delete from vba express.

  6. #6
    VBAX Regular
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    37
    Location
    Quote Originally Posted by maxis View Post
    40 years in IT and many forums, but I’ve never heard this. I will delete from vba express.
    TBH, I find this very hard to believe, espcially if you frequent various forums. Do not go near MrExcel forum, as their notice on crossposting is widely referred to.
    People new to forums tend to be guilty of crossposting, through lack of knowledge. Then again you get the odd few who say 'they do not give a jot', then wonder why they get no responses.?

    People give their time and knowledge freely on forums, and I personally feel it is unfair and a waste for them to likely repeat the same advice.
    Some posters do not like the answer and so post elsewhere only to be told the same thing. there is a reason why that response was offered.

    just let people know where else you have asked. I have done it for you this time.
    It is just a common courtesy.?

  7. #7
    VBAX Regular
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    37
    Location
    Maxis has claimed she is banned from these forums over in AF.net, where the crosspost was made first.
    Is that true?, surely a warning is sufficient until repeated crosspostings?

    Edit:
    OK, I can now spot the banned display.?
    Can we not allow some leniency. My intention was not to get Maxis banned, just make others aware that the query had been asked elsewhere?
    Last edited by Gasman; 07-09-2022 at 08:07 AM. Reason: Spotted Banned display

Tags for this Thread

Posting Permissions

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