Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2024, 03:33 AM
MartinGM MartinGM is offline A tip about using Excel VBA with OneDrive Windows 11 A tip about using Excel VBA with OneDrive Office 2021
Competent Performer
A tip about using Excel VBA with OneDrive
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default A tip about using Excel VBA with OneDrive

Windows 11, Excel 365 and OneDrive



I have some workbooks that use files temporarily stored in a OneDrive folder on my PC

By "use" I mean files are downloaded to the OneDrive folder then opened, data extracted, the file is deleted etc etc etc

Lately my code, which has worked fine for a couple of years, has been playing up - it mostly just fails to execute the commanded file operations without any error messages.

I have finally tracked this down to OneDrive which seems to introduce delays, for instance when a file has been successfully downloaded and the code wants to open it but OneDrive is uploading a copy to the cloud

That's when the code fails. I have VBA checks to see if the file is "there" but haven't found a way to check if the file is actually usable

I've tried several other fixes but none of them work reliably, so I now use a folder outside OneDrive for these operations and all is well again

I have a very fast internet connection but have noticed that OneDrive synch is taking longer than it used to - maybe Microsoft is overloaded. Whatever the reason, I'm so pleased to have functioning VBA again.

Hope this helps someone
Reply With Quote
  #2  
Old 08-10-2024, 11:05 PM
ArviLaanemets ArviLaanemets is offline A tip about using Excel VBA with OneDrive Windows 8 A tip about using Excel VBA with OneDrive Office 2016
Expert
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

In my experience, VBA can't change the contents of files on OneDive - probably the security issue.

The workaround is to store all such files on shared local network drive instead.
Reply With Quote
  #3  
Old 08-12-2024, 12:09 AM
MartinGM MartinGM is offline A tip about using Excel VBA with OneDrive Windows 11 A tip about using Excel VBA with OneDrive Office 2021
Competent Performer
A tip about using Excel VBA with OneDrive
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default

Quote:
Originally Posted by ArviLaanemets View Post
In my experience, VBA can't change the contents of files on OneDive - probably the security issue.

The workaround is to store all such files on shared local network drive instead.
I *can* do file operation in OneDrive folders with Excel VBA - but I have to build in significant delays.

The absence of error messages is a pain.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel, hyperlink to OneDrive file, is this possible The9codgerDrove Excel 0 08-15-2022 04:32 AM
Word-OneDrive-Excel link not working when Word file re-opens Prakash-Gautam Word 0 05-02-2019 07:35 PM
Problem with hyperlinks to Excel workbooks on OneDrive rjxb Excel 0 08-28-2018 10:06 AM
OneDrive + iPhone Excel: Cannot Update Workbook? markg2 Excel 0 12-07-2014 09:02 AM
Excel function does not work in OneDrive for Business Laibiang Excel 0 11-04-2014 07:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft