Hi Folks,

I have some code that I use to output to a text file.
It works fine if the file it is located in is stored on a local drive.
However, if the file is stored on OneDrive it generates a "Bad file name or number" error.
Can I adapt this code to work when the file is located on OneDrive?
The file is used by numerous people so it needs to handle the OneDrive path dynamically.

Open ActiveWorkbook.Path & "/" + strOutputFileName For Output As f