Bug 126458

Summary: FILEOPEN XLSX VBA file open does not work with relative path
Product: LibreOffice Reporter: NISZ LibreOffice Team <libreoffice>
Component: BASICAssignee: Andreas Heinisch <andreas.heinisch>
Status: RESOLVED NOTABUG    
Severity: normal CC: 79045_79045, andreas.heinisch, himajin100000, kelemeng, nemeth, raal
Priority: medium    
Version: 4.1.0.4 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108908    
Attachments: Example file from Excel with the macro
Example file from Excel to open by the macro
Screenshot of the problem in Calc

Description NISZ LibreOffice Team 2019-07-18 08:30:48 UTC
Description:
Attached example XLSX file has a VBA macro that tries to open another XLSX file referencing only by name. Excel can do this, but Calc cannot, it requires full path too.

Steps to Reproduce:
1.	Download the example files to the same directory
2.	Open attached file and try to run the FileOpenExample macro


Actual Results:
Instead of opening the Example.xlsx file it gives an Unsupported URL error.

Expected Results:
It would be nice to open the file, just like Excel.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.0.0.alpha0+ (x86)
Build ID: 49422a469646ad8be43ba828ca24c2484c26b9e8
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-07-08_00:50:19
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: CL
Comment 1 NISZ LibreOffice Team 2019-07-18 08:31:22 UTC
Created attachment 152849 [details]
Example file from Excel with the macro
Comment 2 NISZ LibreOffice Team 2019-07-18 08:31:41 UTC
Created attachment 152850 [details]
Example file from Excel to open by the macro
Comment 3 NISZ LibreOffice Team 2019-07-18 08:31:59 UTC
Created attachment 152851 [details]
Screenshot of the problem in Calc
Comment 4 raal 2019-07-21 19:32:25 UTC
Confirm with Version: 6.4.0.0.alpha0+
Build ID: 47a774fbef8c224e4853de3fdd0230b9442bb716
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 

and Version: 4.1.0.0.alpha1+
Build ID: 863d38fbfa4fb4861e476828c46410602100919
Comment 7 QA Administrators 2021-09-12 03:48:37 UTC Comment hidden (obsolete)
Comment 8 Roman Kuznetsov 2021-09-12 18:04:56 UTC
still repro in 

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 23f17b7ea6fbd2f422c7e40192ae60e4df25224c
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded
Comment 9 Andreas Heinisch 2021-09-14 19:31:59 UTC
Shouldn't the system path be given in URL notation?

Option VBASupport 1
  Public Sub FileOpenExample()
  file1 = "file:///Example.xlsx"

  Workbooks.Open Filename:=file1

End Sub
Comment 10 Andreas Heinisch 2022-09-30 13:56:47 UTC
I tried the test file in Excel and it does not work there either. It seems you have to put an absolute file path in any case. I will close it as NOTABUG since it works as intended even in MS.