Problem with StarDesktop.loadComponentFromURL

Ever since Star Office 9 I have been using Macros that have this code or identical ones with the Symbols changed:

Sub OpenDJIA_History
    rem define variables

    Dim Doc As Object
    Dim File As String
    Dim URL As String

    rem get access to the document

    File = "C:\Users\Doug & Dolores\Dropbox\Fund Data\39Wk Avgs\DJIA History"

    URL = ConvertToURL( File + ".ods" ) 

    Doc = StarDesktop.loadComponentFromURL(URL, "_default", 0, Array() )
End Sub

Now all of the sudden when stepping through or running this Macro sub routine I get the following Error Message:

BASIC runtime error.
An exception occurred
 
Type: com.sun.star.lang.IllegalArgumentExceptionMessage: Unsupported URL 

<file:///C:/Users/Doug%20&%20Dolores/Dropbox/Fund%20Data/39Wk%20Avgs/DJIA%20History.ods>: "type detection failed".

Any idea what has happend or how to correct the “loadComponentFromURL” code?

What about copy “DJIA History.ods” from DropBox to local hard disk? For example to folder C:\Tests.

That’s the way it was years ago at first, but since almost 7-8 years ago I have been using DropBox and it worked perfectly until yesterday when I was trying to copy this sub to a new Macro.

FYI - I tried your suggestion with a C:\Test\DJA_History. It worked.
Here is the code:

sub OpenDJA_History
rem define variables

Dim Doc As Object
Dim File As String
Dim URL As String

rem get access to the document

File = "C:\Test\DJA History"

URL = ConvertToURL( File + ".ods" ) 

Doc = StarDesktop.loadComponentFromURL(URL, "_default", 0, Array() )

End Sub

So my guess is that something has changed in LibreOffice that doesn’t like the path to DropBox.

Does it work with an & in the filename in Test directory?

Btw: to properly format the code, it should be all indented by additional 4 spaces.

Also: the error is returned from LoadEnv::impl_detectTypeAndFilter() when there’s no valid content found; could that be that the file itself is corrupt?