Bug 153593 - VBA SaveAs method with relative file paths does not work
Summary: VBA SaveAs method with relative file paths does not work
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: implementationError
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2023-02-13 15:29 UTC by Gabor Kelemen (allotropia)
Modified: 2025-03-28 03:11 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Calc (49.75 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2023-02-13 15:29 UTC, Gabor Kelemen (allotropia)
Details
List of created files after running all the macros in Excel 2016 (131.91 KB, image/png)
2023-02-13 15:33 UTC, Gabor Kelemen (allotropia)
Details
Error message by Calc master (62.06 KB, image/png)
2023-02-13 15:34 UTC, Gabor Kelemen (allotropia)
Details
Same error message with the third macro as well (57.24 KB, image/png)
2023-02-13 15:34 UTC, Gabor Kelemen (allotropia)
Details
Saving with the save_as_file_fp is successful (87.54 KB, image/png)
2023-02-13 15:40 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2023-02-13 15:29:09 UTC
Created attachment 185348 [details]
Example file from Calc

This is a bit of continuation after bug 149786
Attached example file is derived from attachment 181030 [details] of that bug.

Now that the ExportAsFixedFormat is implemented, we see it failing on the filename specification used in that macro: 
 Filename:=".\ExportAsPDF.pdf",

A bit of experimentation found that the SaveAs method also has this error.

1, Open attached file
2, Run the macros in Calc

Result: when running the ExportAsPDF macros (with https://gerrit.libreoffice.org/c/core/+/146512 applied locally), they save the PDF files correctly except the  Filename:=".\ExportAsPDF_dot.pdf" case.

The save_as_file macros are worse: only the save_as_file_fp works, and the other two with filename specifications:
    Filename:=".\FileSaveTest_dot"
and
    Filename:="FileSaveTest_fn"
cause an error dialog.

These should produce an output file like save_as_file_fp() does.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6028e9fda96d0ed5da266b1c54a7755f7ba3408c
CPU threads: 14; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

Happens since 4.1, before the SaveAs method was not implemented at all.
Comment 1 Gabor Kelemen (allotropia) 2023-02-13 15:33:29 UTC
Created attachment 185349 [details]
List of created files after running all the macros in Excel 2016
Comment 2 Gabor Kelemen (allotropia) 2023-02-13 15:34:04 UTC
Created attachment 185350 [details]
Error message by Calc master
Comment 3 Gabor Kelemen (allotropia) 2023-02-13 15:34:55 UTC
Created attachment 185351 [details]
Same error message with the third macro as well
Comment 4 Gabor Kelemen (allotropia) 2023-02-13 15:40:51 UTC
Created attachment 185352 [details]
Saving with the save_as_file_fp is successful

With an absolute path given the save succeeds.
File extension was not auto-added, will file that as a separate report.
Comment 5 Buovjaga 2023-03-28 11:48:22 UTC
I confirm the save as error.

The PDF file produced:
.\ExportAsPDF_dot.pdf

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 98cf5157d69d9f1692be7f2cac958b1dfb387ca9
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 28 March 2023
Comment 6 QA Administrators 2025-03-28 03:11:41 UTC
Dear Gabor Kelemen (allotropia),

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug