Bug 126458 - FILEOPEN XLSX VBA file open does not work with relative path
Summary: FILEOPEN XLSX VBA file open does not work with relative path
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2019-07-18 08:30 UTC by NISZ LibreOffice Team
Modified: 2022-09-30 13:56 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel with the macro (17.08 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2019-07-18 08:31 UTC, NISZ LibreOffice Team
Details
Example file from Excel to open by the macro (14.01 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-07-18 08:31 UTC, NISZ LibreOffice Team
Details
Screenshot of the problem in Calc (67.91 KB, image/png)
2019-07-18 08:31 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
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.