cristianbuse / VBA-FileTools

Useful methods for interacting with the file system
MIT License
81 stars 23 forks source link

GetLocalPath returns blank for Onedrive Business1 #17

Closed SIFAR786 closed 12 months ago

SIFAR786 commented 1 year ago

Hi,

This does not seem to work anymore. It was working few weeks ago, but today it is not working any longer. Any reason why this could be happening? It seems to return blank.

        spath = GetLocalPath(ThisWorkbook.Path)        
        If InStrRev(spath, "\", -1, vbTextCompare) > 0 Then
            spath = spath & "\"
        End If
        sName = spath & ThisWorkbook.Name
cristianbuse commented 1 year ago

Hi @SIFAR786 ,

Thanks for raising the issue!

It seems that my tests are still passing. There must be a new Office update that is causing the issue. I will try to get my hands on a computer that has the latest updates and will let you know.

Could you please check if this solution also fails? Thanks!

cristianbuse commented 1 year ago

Hi @SIFAR786 ,

It seems the latest One Drive update has moved the main dat file from the regular location. I use that file to correctly map folder names and so the solution doesn't work anymore.

Seems that the gist I linked in my previous post also stopped working as it's based on the same logic. Until I find a solution, you can try using this

cristianbuse commented 12 months ago

Hi @SIFAR786 ,

I've pushed commit 995ca7f which now reads the SQLite settings file instead of the old dat file.

It would be great if you could test the new solution. I've already tested on different computers on both x32 and x64 Windows and Mac.

Thanks for your feedback!

Greedquest commented 11 months ago

that commit is insane. No sqlite driver needed I guess ;)

cristianbuse commented 11 months ago

Thanks @Greedquest !

Me and Guido are just trying to keep these type of libraries as small as possible with little or no dependencies.

Haven't been in touch for a while. Did you manage to finalize the package manager?

Greedquest commented 11 months ago

Hi yes been a while. I do think the ability to keep it portable is very impressive, although I suppose it's more fragile if the memory layout in the sqlite file changes even though the schema might not -like with a sqlite version bump.

Package manager thanks for asking, I hit a roadblock where it was getting too complex and I also wanted to see the direction RD and tB took on editor integration and language servers. It was also starting to venture into the realms of 100% hobby as opposed to maybe arguably work related, so that slashed the time I could work on it.

Still think it'd be cool to work on more though... I also want to release some good quality projects to host on the package manager too.

cristianbuse commented 11 months ago

@Greedquest

I suppose it's more fragile if the memory layout in the sqlite file changes even though the schema might not -like with a sqlite version bump

Totally agree. It's a tradeoff that requires lots of testing and maintenance.

I also wanted to see the direction RD and tB took on editor integration and language servers

Makes a lot of sense. Will be a complete game changer if RD could provide package management. tB is a no no for my company - one of the reasons I stopped contributing.

It was also starting to venture into the realms of 100% hobby as opposed to maybe arguably work related

This weighs heavily on my decisions as well. All of my repositories on GitHub have started as a need in my day to day job.

Still think it'd be cool to work on more though... I also want to release some good quality projects to host on the package manager too.

Well, if RD doesn't provide then I would be interested to collaborate on this in the future.

Cheers!