Bug 155360 - Workbook.PrintOut 423. property or method not found
Summary: Workbook.PrintOut 423. property or method not found
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.5.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 161314 (view as bug list)
Depends on:
Blocks: Macro-VBA-Error423
  Show dependency treegraph
 
Reported: 2023-05-16 17:23 UTC by johnks
Modified: 2024-05-30 04:44 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
423 for printout (222.69 KB, image/png)
2023-05-16 17:24 UTC, johnks
Details
file containing bug (8.82 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2024-05-29 16:26 UTC, johnks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description johnks 2023-05-16 17:23:42 UTC
Description:
https://learn.microsoft.com/en-us/office/vba/api/Excel.Workbook.PrintOut


 ThisWorkbook.PrintOut , Preview:=True

this is the problematic code. Screenshot attached.

https://www.teachexcel.com/free-excel-macros/m-64,Complete-Guide-to-Printing-in-Excel-Macros-PrintOut-Method-in-Excel.html

try to run this example macro in libreoffice

Steps to Reproduce:
1. try to run macro with printout 
2.
3.

Actual Results:
423 error

Expected Results:
macro should work as it works in excel


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Flatpak
Calc: threaded
Comment 1 johnks 2023-05-16 17:24:08 UTC
Created attachment 187336 [details]
423 for printout
Comment 2 johnks 2023-06-05 05:14:20 UTC
https://www.exceldemy.com/excel-vba-print-preview/

i downloaded this file

https://www.exceldemy.com/wp-content/uploads/2022/02/VBA-Print-Preview.xlsm


found out the following


ActiveWindow.SelectedSheets.PrintPreview
 (this works in calc)


Worksheets("Specific Sheet").PrintPreview
(method or property not found)

ActiveSheet.PrintPreview
(method or property not found)



this is quite a good example of what works and what does not work in calc with regards to the formulae

---

Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Flatpak
Calc: threaded
Comment 3 johnks 2024-05-29 15:44:55 UTC
*** Bug 161314 has been marked as a duplicate of this bug. ***
Comment 4 johnks 2024-05-29 16:26:04 UTC
Created attachment 194430 [details]
file containing bug

simple code 
ThisWorkbook.PrintOut , Preview:=True
in sheet 4



the file says 423 on this macro but elsewhere it sometimes show 92 error
Comment 5 Stéphane Guillou (stragu) 2024-05-30 00:28:11 UTC
johnks, reports usually need to be set to "new" by someone other than the report. Setting back to "unconfirmed".

Mike, what do you think?
Comment 6 Mike Kaganski 2024-05-30 04:44:50 UTC
(In reply to Stéphane Guillou (stragu) from comment #5)
> Mike, what do you think?

Any VBA that works in MS Office, but fails in LibreOffice, is an interoperability bug. Sometimes there might appear a reason to not fix some specific cases of these bugs (but they don't cease to be bugs nonetheless, just may be closed as WONTFIX) - but this is even not that corner case. Just a normal bug.

We only have PrintOut defined for several VBA object model objects:

https://opengrok.libreoffice.org/search?project=core&full=printout&path=vba%2Fexcel

VBA defines it for much larger set of objects:

https://learn.microsoft.com/en-us/search/?terms=Excel%20PrintOut

Workbook is one of these objects, that misses the method in out code.

https://learn.microsoft.com/en-us/office/vba/api/excel.workbook.printout

Note that we need separate bugs for different methods. We can't have an actionable "implement perfect VBA support" bug. Please create a similar bug for PrintPreview, and likewise for any other missing object/property/method.