Bug 153595 - VBA SaveAs method does not add default file extension
Summary: VBA SaveAs method does not add default file extension
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:59 UTC by Gabor Kelemen (allotropia)
Modified: 2025-03-28 03:11 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

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:59:28 UTC
This is a continuation of bug 153593

Another issue with the example macro in attachment 185348 [details] is that Excel uses a default extension if there is none given, but Calc does not:

Sub save_as_file_fp()
    ActiveWorkbook.SaveAs _
    Filename:=Application.ActiveWorkbook.Path & ".\FileSaveTest_fp"
End Sub

With the above macro Excel outputs a "FileSaveTest_fp.xlsm" file (saves the example file with the new Filename and same format, adding and extension matching the format) and Calc just "FileSaveTest_fp".

Manually adding an xlsm or xlsx extension, then opening it in Excel gives an "invalid file" error which is the same as bug 118146.
(Adding an xls extension makes Excel open it fine)

1. Open attachment 185348 [details]
2. Run save_as_file_fp()
3. Observe that the created file does not have an xlsm (expected) or any other file name extension.

How it looks after running it in Excel: attachment 185349 [details]
How it looks after running it in Calc: attachment 185352 [details]

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 Buovjaga 2023-03-28 11:51:47 UTC
Repro.

I had the original file in path libobugs/vboxshare and the macro created a file called vboxshare.\FileSaveTest_fp in libobugs

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 2 QA Administrators 2025-03-28 03:11:43 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